sunhao 5 years ago
parent
commit
3f4981e481
1 changed files with 1 additions and 5 deletions
  1. 1 5
      app/Http/Controllers/Admin/StatisticsController.php

+ 1 - 5
app/Http/Controllers/Admin/StatisticsController.php

@@ -1878,11 +1878,7 @@ class StatisticsController extends Controller
1878 1878
         $result = $this->teamCtimePage_export($stime, $etime, $team_id);
1879 1879
 
1880 1880
         foreach($result as $k=>&$v){
1881
-            $order_result = Order::select(DB::raw('team_id, count(1) as order_count, sum(receivedAmount) as receivedAmount, sum(if(payment_type=1,receivedAmount,null)) as wx_money'))->where(function($query) use($team_id, $stime, $etime){
1882
-                if($team_id) $query->where('team_id', $team_id);
1883
-                if($stime) $query->where('createTime', '>=', $stime);
1884
-                if($etime) $query->where('createTime', '<=', $etime.' 23:59:59');
1885
-            })->where('is_del', 0)->whereRaw('left(createTime, 10)='.$v['date'])->where('team_id', $v['team_id'])->first();
1881
+            $order_result = Order::select(DB::raw('team_id, count(1) as order_count, sum(receivedAmount) as receivedAmount, sum(if(payment_type=1,receivedAmount,null)) as wx_money'))->where('is_del', 0)->where('createTime','>=', $v['date'])->where('createTime','<=', $v['date'].' 23:59:59')->where('team_id', $v['team_id'])->first();
1886 1882
 
1887 1883
             $v['order_count'] = isset($order_result->order_count) ? $order_result->order_count : '';
1888 1884
             $v['receivedAmount'] = isset($order_result->receivedAmount) ? $order_result->receivedAmount : '';