<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 營業狀況 >[info]功能: 1,顯示數據:通過 `yf_shop_base` 門店表 顯示門店 /* *@desc ajax列表頁面數據處理 */ static function ajax_data_reset($data){ $payment_way = config('payment'); $arr = [ '商品銷售'=>'wp_order,payid,good_price,ended,wp_order_return,goods_price', /*'會員充值'=>'wp_recharge,payment_way,money,created',*/ '現金收支'=>[ 'user_price', 'return_price' ], '總計'=>'wp_order', ]; foreach ($data as $v){ unset($new_data); $new_data['title'] = $title = $v->title; $new_data['first'] = "-"; $i = 0; $total = []; foreach($arr as $k1=>$relative){ //各種支付方式,對應的總數sum foreach($payment_way as $_k => $payid){ $new_data[$_k] = "-"; } $flag = false; switch ($k1) { case '商品銷售': $flag = true; $xiao = $v->wp_order->sum('good_price') - $v->wp_order_return->sum('goods_price'); $new_data['first'] = __("銷售額")." ".$xiao." ".__("訂單數")." ".$v->wp_order->count(); break; /*case '會員充值': $flag = true; $new_data['first'] = __("充值")." ".$v->wp_recharge->sum('money'); break;*/ case '現金收支': $flag = false; $obj = $v->wp_order->where('payid',$payment_way['cash']); $a = $obj->sum('user_price'); $b = $obj->sum('return_price'); $new_data['first'] = __("收入")." ".$a ." ".__("支出")." ".$b; $new_data['cash'] = $obj->sum('good_price'); break; case '總計': $flag = true; $new_data['first'] = "-"; break; } if($flag === true){ if(strpos($relative,',')!==false){ $ex = explode(',', $relative); $orm = $ex[0]; $whereKey = $ex[1]; $sum = $ex[2]; //各種支付方式,對應的總數sum foreach($payment_way as $_k => $payid){ $new_data[$_k] = $v->$orm->where($whereKey,$payid)->sum($sum); } } } if($k1 == '總計'){ foreach($payment_way as $_k => $payid){ $new_data[$_k] = "-"; } } $output[$title][$k1] = (object)$new_data; $i++; } } return $output; } >[info] 2,通過支付方式 configs payment 文件 `wp_order` 訂單表 和 `wp_order_return` 退貨表計算 當天的營業情況 /** *@desc 訂單 */ public function wp_order() { $start_time = request_data('start_time')?:date('Y-m-d 00:00:00', time()); $end_time = request_data('end_time')?:date('Y-m-d 23:59:59', time()); $end_time = ($end_time == $start_time)?date('Y-m-d 23:59:59', strtotime($end_time)):$end_time; return $this->hasMany('models\wp_order','shop_id') ->where('ended','>=',strtotime($start_time)) ->where('ended','<=',strtotime($end_time)) ->where('type','!=',1); } /** *@desc 訂單 */ public function wp_order_return() { $start_time = request_data('start_time')?:date('Y-m-d 00:00:00', time()); $end_time = request_data('end_time')?:date('Y-m-d 23:59:59', time()); $end_time = ($end_time == $start_time)?date('Y-m-d 23:59:59', strtotime($end_time)):$end_time; return $this->hasMany('models\wp_order_return','shop_id') ->where('created','>=',strtotime($start_time)) ->where('created','<=',strtotime($end_time)) ->where('type','!=',1); }
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看