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

+ 9 - 9
app/Http/Controllers/Admin/StatisticsController.php

@@ -1784,21 +1784,21 @@ class StatisticsController extends Controller
1784 1784
                 $query->where('team_id', $team);
1785 1785
                 $query->where('aftersale_time', '>=', $ctime);
1786 1786
                 $query->where('aftersale_time', '<=', $ctime.' 23:59:59');
1787
-            })->where('is_del', 0)->first();
1787
+            })->where('is_del', 0)->where('aftersale_fee', '>', 0)->first();
1788 1788
             $v['aftersale_count'] = $aftersale_info->aftersale_count;
1789 1789
             $v['aftersale_fee'] = $aftersale_info->aftersale_fee;
1790 1790
             #退补
1791 1791
             $refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where(function($query) use($team, $ctime){
1792 1792
                 $query->where('team_id', $team);
1793 1793
                 $query->where('refund_time', '=', $ctime);
1794
-            })->where('is_del', 0)->first();
1794
+            })->where('is_del', 0)->where('refund_price', 'is not', null)->first();
1795 1795
             $v['refund_count'] = $refund_info->refund_count;
1796 1796
             $v['refund_price'] = $refund_info->refund_price;
1797 1797
             #发货
1798 1798
             $send_info = Order::select(DB::raw('count(1) as send_count, sum(cost) as cost, sum(freight_cost) as freight_cost'))->where(function($query) use($team, $ctime){
1799 1799
                 $query->where('team_id', $team);
1800 1800
                 $query->where('send_time', '=', $ctime);
1801
-            })->where('is_del', 0)->first();
1801
+            })->where('is_del', 0)->where('logistics_id', '>', '')->first();
1802 1802
             $v['send_count'] = $send_info->send_count;
1803 1803
             $v['cost'] = $send_info->cost;
1804 1804
             $v['freight_cost'] = $send_info->freight_cost;
@@ -1877,21 +1877,21 @@ class StatisticsController extends Controller
1877 1877
                 $query->where('team_id', $team);
1878 1878
                 $query->where('aftersale_time', '>=', $ctime);
1879 1879
                 $query->where('aftersale_time', '<=', $ctime.' 23:59:59');
1880
-            })->where('is_del', 0)->first();
1880
+            })->where('is_del', 0)->where('aftersale_fee','>',0)->first();
1881 1881
             $v['aftersale_count'] = $aftersale_info->aftersale_count;
1882 1882
             $v['aftersale_fee'] = $aftersale_info->aftersale_fee;
1883 1883
 
1884 1884
             $refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where(function($query) use($team, $ctime){
1885 1885
                 $query->where('team_id', $team);
1886 1886
                 $query->where('refund_time', '=', $ctime);
1887
-            })->where('is_del', 0)->first();
1887
+            })->where('is_del', 0)->where('refund_price', 'is not', null)->first();
1888 1888
             $v['refund_count'] = $refund_info->refund_count;
1889 1889
             $v['refund_price'] = $refund_info->refund_price;
1890 1890
             #发货
1891 1891
             $send_info = Order::select(DB::raw('count(1) as send_count, sum(cost) as cost, sum(freight_cost) as freight_cost'))->where(function($query) use($team, $ctime){
1892 1892
                 $query->where('team_id', $team);
1893 1893
                 $query->where('send_time', '=', $ctime);
1894
-            })->where('is_del', 0)->first();
1894
+            })->where('is_del', 0)->where('logistics_id','>','')->first();
1895 1895
             $v['send_count'] = $send_info->send_count;
1896 1896
             $v['cost'] = $send_info->cost;
1897 1897
             $v['freight_cost'] = $send_info->freight_cost;
@@ -1994,7 +1994,7 @@ class StatisticsController extends Controller
1994 1994
             if($stime) $query->where('refund_time', '>=', $stime);
1995 1995
             if($etime) $query->where('refund_time', '<=', $etime);
1996 1996
 
1997
-        })->where('is_del', 0)->where('refund_price', '>', 0)->count();
1997
+        })->where('is_del', 0)->where('refund_price', 'is not', null)->count();
1998 1998
         if ($count > 1) {
1999 1999
             // 总页数
2000 2000
             $pages = ceil($count/$pageSize);
@@ -2008,7 +2008,7 @@ class StatisticsController extends Controller
2008 2008
             if($team_id) $query->where('team_id', $team_id);
2009 2009
             if($stime ) $query->where('refund_time', '>=', $stime);
2010 2010
             if($etime ) $query->where('refund_time', '<=', $etime);
2011
-        })->where('is_del', 0)->where('refund_price', '>', 0);
2011
+        })->where('is_del', 0)->where('refund_price', 'is not', null);
2012 2012
 
2013 2013
         $result = $resultQuery->orderBy('refund_time','desc')->offset($offset)->limit($pageSize)->get();
2014 2014
         
@@ -2142,7 +2142,7 @@ class StatisticsController extends Controller
2142 2142
             if($team_id) $query->where('team_id', $team_id);
2143 2143
             if($stime ) $query->where('refund_time', '>=', $stime);
2144 2144
             if($etime ) $query->where('refund_time', '<=', $etime);
2145
-        })->where('is_del', 0)->where('refund_price', '>', 0);
2145
+        })->where('is_del', 0)->where('refund_price', 'is not', null);
2146 2146
 
2147 2147
         $result = $resultQuery->orderBy('refund_time','desc')->get();
2148 2148