|
@@ -1733,7 +1733,7 @@ class StatisticsController extends Controller
|
1733
|
1733
|
if($stime) $query->where('createTime', '>=', $stime);
|
1734
|
1734
|
if($etime) $query->where('createTime', '<=', $etime. ' 23:59:59');
|
1735
|
1735
|
|
1736
|
|
- })->where('is_del', 0)->count();
|
|
1736
|
+ })->where('is_del', 0)->where('status','>=',2)->count();
|
1737
|
1737
|
if ($count > 1) {
|
1738
|
1738
|
// 总页数
|
1739
|
1739
|
$pages = ceil($count/$pageSize);
|
|
@@ -1747,7 +1747,7 @@ class StatisticsController extends Controller
|
1747
|
1747
|
if($team_id) $query->where('team_id', $team_id);
|
1748
|
1748
|
if($stime ) $query->where('createTime', '>=', $stime);
|
1749
|
1749
|
if($etime ) $query->where('createTime', '<=', $etime. ' 23:59:59');
|
1750
|
|
- })->where('is_del', 0)->orderBy('team_id', 'asc');
|
|
1750
|
+ })->where('is_del', 0)->where('status','>=',2)->orderBy('team_id', 'asc');
|
1751
|
1751
|
|
1752
|
1752
|
$result = $resultQuery->orderBy('createTime','desc')->offset($offset)->limit($pageSize)->get();
|
1753
|
1753
|
|
|
@@ -1805,7 +1805,7 @@ class StatisticsController extends Controller
|
1805
|
1805
|
$teams = DB::table('teams')->lists('name', 'id');
|
1806
|
1806
|
|
1807
|
1807
|
foreach($_data['data'] as $k=>&$v){
|
1808
|
|
- $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();
|
|
1808
|
+ $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('status','>=',2)->where('createTime','>=', $v['date'])->where('createTime','<=', $v['date'].' 23:59:59')->where('team_id', $v['team_id'])->first();
|
1809
|
1809
|
|
1810
|
1810
|
$v['order_count'] = isset($order_result->order_count) ? $order_result->order_count : '';
|
1811
|
1811
|
$v['receivedAmount'] = isset($order_result->receivedAmount) ? $order_result->receivedAmount : '';
|
|
@@ -1819,28 +1819,28 @@ class StatisticsController extends Controller
|
1819
|
1819
|
$query->where('team_id', $team);
|
1820
|
1820
|
$query->where('aftersale_time', '>=', $ctime);
|
1821
|
1821
|
$query->where('aftersale_time', '<=', $ctime.' 23:59:59');
|
1822
|
|
- })->where('is_del', 0)->where('aftersale_fee', '>', 0)->first();
|
|
1822
|
+ })->where('is_del', 0)->where('status','>=',2)->where('aftersale_fee', '>', 0)->first();
|
1823
|
1823
|
$v['aftersale_count'] = $aftersale_info->aftersale_count;
|
1824
|
1824
|
$v['aftersale_fee'] = $aftersale_info->aftersale_fee;
|
1825
|
1825
|
#退补
|
1826
|
1826
|
$refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where(function($query) use($team, $ctime){
|
1827
|
1827
|
$query->where('team_id', $team);
|
1828
|
1828
|
$query->where('refund_time', '=', $ctime);
|
1829
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
|
1829
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
1830
|
1830
|
$v['refund_count'] = $refund_info->refund_count;
|
1831
|
1831
|
$v['refund_price'] = $refund_info->refund_price;
|
1832
|
1832
|
//wx退补
|
1833
|
1833
|
$wx_refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where('refund_type', 1)->where(function($query) use($team, $ctime){
|
1834
|
1834
|
$query->where('team_id', $team);
|
1835
|
1835
|
$query->where('refund_time', '=', $ctime);
|
1836
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
|
1836
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
1837
|
1837
|
$v['wx_refund_count'] = $wx_refund_info->refund_count;
|
1838
|
1838
|
$v['wx_refund_price'] = $wx_refund_info->refund_price;
|
1839
|
1839
|
//付款码退补
|
1840
|
1840
|
$zfm_refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where('refund_type', 2)->where(function($query) use($team, $ctime){
|
1841
|
1841
|
$query->where('team_id', $team);
|
1842
|
1842
|
$query->where('refund_time', '=', $ctime);
|
1843
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
|
1843
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
1844
|
1844
|
$v['zfm_refund_count'] = $zfm_refund_info->refund_count;
|
1845
|
1845
|
$v['zfm_refund_price'] = $zfm_refund_info->refund_price;
|
1846
|
1846
|
|
|
@@ -1848,7 +1848,7 @@ class StatisticsController extends Controller
|
1848
|
1848
|
$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){
|
1849
|
1849
|
$query->where('team_id', $team);
|
1850
|
1850
|
$query->where('send_time', '=', $ctime);
|
1851
|
|
- })->where('is_del', 0)->where('logistics_id', '>', '')->first();
|
|
1851
|
+ })->where('is_del', 0)->where('status','>=',2)->where('logistics_id', '>', '')->first();
|
1852
|
1852
|
$v['send_count'] = $send_info->send_count;
|
1853
|
1853
|
$v['cost'] = $send_info->cost;
|
1854
|
1854
|
$v['freight_cost'] = $send_info->freight_cost;
|
|
@@ -1890,7 +1890,7 @@ class StatisticsController extends Controller
|
1890
|
1890
|
if($team_id) $query->where('team_id', $team_id);
|
1891
|
1891
|
if($stime ) $query->where('createTime', '>=', $stime);
|
1892
|
1892
|
if($etime ) $query->where('createTime', '<=', $etime. ' 23:59:59');
|
1893
|
|
- })->where('is_del', 0)->orderBy('team_id', 'asc');
|
|
1893
|
+ })->where('is_del', 0)->where('status','>=',2)->orderBy('team_id', 'asc');
|
1894
|
1894
|
|
1895
|
1895
|
$result = $resultQuery->orderBy('createTime','desc')->get();
|
1896
|
1896
|
$result = json_decode(json_encode($result), true);
|
|
@@ -1919,7 +1919,7 @@ class StatisticsController extends Controller
|
1919
|
1919
|
$result = $this->teamCtimePage_export($stime, $etime, $team_id);
|
1920
|
1920
|
|
1921
|
1921
|
foreach($result as $k=>&$v){
|
1922
|
|
- $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();
|
|
1922
|
+ $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('status','>=',2)->where('createTime','>=', $v['date'])->where('createTime','<=', $v['date'].' 23:59:59')->where('team_id', $v['team_id'])->first();
|
1923
|
1923
|
|
1924
|
1924
|
$v['order_count'] = isset($order_result->order_count) ? $order_result->order_count : '';
|
1925
|
1925
|
$v['receivedAmount'] = isset($order_result->receivedAmount) ? $order_result->receivedAmount : '';
|
|
@@ -1933,28 +1933,28 @@ class StatisticsController extends Controller
|
1933
|
1933
|
$query->where('team_id', $team);
|
1934
|
1934
|
$query->where('aftersale_time', '>=', $ctime);
|
1935
|
1935
|
$query->where('aftersale_time', '<=', $ctime.' 23:59:59');
|
1936
|
|
- })->where('is_del', 0)->where('aftersale_fee', '>', 0)->first();
|
|
1936
|
+ })->where('is_del', 0)->where('status','>=',2)->where('aftersale_fee', '>', 0)->first();
|
1937
|
1937
|
$v['aftersale_count'] = $aftersale_info->aftersale_count;
|
1938
|
1938
|
$v['aftersale_fee'] = $aftersale_info->aftersale_fee;
|
1939
|
1939
|
#退补
|
1940
|
1940
|
$refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where(function($query) use($team, $ctime){
|
1941
|
1941
|
$query->where('team_id', $team);
|
1942
|
1942
|
$query->where('refund_time', '=', $ctime);
|
1943
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
|
1943
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
1944
|
1944
|
$v['refund_count'] = $refund_info->refund_count;
|
1945
|
1945
|
$v['refund_price'] = $refund_info->refund_price;
|
1946
|
1946
|
//wx退补
|
1947
|
1947
|
$wx_refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where('refund_type', 1)->where(function($query) use($team, $ctime){
|
1948
|
1948
|
$query->where('team_id', $team);
|
1949
|
1949
|
$query->where('refund_time', '=', $ctime);
|
1950
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
|
1950
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
1951
|
1951
|
$v['wx_refund_count'] = $wx_refund_info->refund_count;
|
1952
|
1952
|
$v['wx_refund_price'] = $wx_refund_info->refund_price;
|
1953
|
1953
|
//付款码退补
|
1954
|
1954
|
$zfm_refund_info = Order::select(DB::raw('count(1) as refund_count, sum(refund_price) as refund_price'))->where('refund_type', 2)->where(function($query) use($team, $ctime){
|
1955
|
1955
|
$query->where('team_id', $team);
|
1956
|
1956
|
$query->where('refund_time', '=', $ctime);
|
1957
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
|
1957
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1)->first();
|
1958
|
1958
|
$v['zfm_refund_count'] = $zfm_refund_info->refund_count;
|
1959
|
1959
|
$v['zfm_refund_price'] = $zfm_refund_info->refund_price;
|
1960
|
1960
|
|
|
@@ -1962,7 +1962,7 @@ class StatisticsController extends Controller
|
1962
|
1962
|
$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){
|
1963
|
1963
|
$query->where('team_id', $team);
|
1964
|
1964
|
$query->where('send_time', '=', $ctime);
|
1965
|
|
- })->where('is_del', 0)->where('logistics_id', '>', '')->first();
|
|
1965
|
+ })->where('is_del', 0)->where('status','>=',2)->where('logistics_id', '>', '')->first();
|
1966
|
1966
|
$v['send_count'] = $send_info->send_count;
|
1967
|
1967
|
$v['cost'] = $send_info->cost;
|
1968
|
1968
|
$v['freight_cost'] = $send_info->freight_cost;
|
|
@@ -2008,7 +2008,7 @@ class StatisticsController extends Controller
|
2008
|
2008
|
if($stime) $query->where('aftersale_time', '>=', $stime);
|
2009
|
2009
|
if($etime) $query->where('aftersale_time', '<=', $etime. ' 23:59:59');
|
2010
|
2010
|
|
2011
|
|
- })->where('is_del', 0)->where('aftersale_fee', '>', 0)->count();
|
|
2011
|
+ })->where('is_del', 0)->where('status','>=',2)->where('aftersale_fee', '>', 0)->count();
|
2012
|
2012
|
if ($count > 1) {
|
2013
|
2013
|
// 总页数
|
2014
|
2014
|
$pages = ceil($count/$pageSize);
|
|
@@ -2023,7 +2023,7 @@ class StatisticsController extends Controller
|
2023
|
2023
|
if($warehouse) $query->where('warehouse', $warehouse);
|
2024
|
2024
|
if($stime ) $query->where('aftersale_time', '>=', $stime);
|
2025
|
2025
|
if($etime ) $query->where('aftersale_time', '<=', $etime. ' 23:59:59');
|
2026
|
|
- })->where('is_del', 0)->where('aftersale_fee', '>', 0);
|
|
2026
|
+ })->where('is_del', 0)->where('status','>=',2)->where('aftersale_fee', '>', 0);
|
2027
|
2027
|
|
2028
|
2028
|
$result = $resultQuery->orderBy('aftersale_time','desc')->offset($offset)->limit($pageSize)->get();
|
2029
|
2029
|
|
|
@@ -2082,7 +2082,7 @@ class StatisticsController extends Controller
|
2082
|
2082
|
if($stime) $query->where('refund_time', '>=', $stime);
|
2083
|
2083
|
if($etime) $query->where('refund_time', '<=', $etime);
|
2084
|
2084
|
|
2085
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1)->count();
|
|
2085
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1)->count();
|
2086
|
2086
|
if ($count > 1) {
|
2087
|
2087
|
// 总页数
|
2088
|
2088
|
$pages = ceil($count/$pageSize);
|
|
@@ -2097,7 +2097,7 @@ class StatisticsController extends Controller
|
2097
|
2097
|
if($warehouse) $query->where('warehouse', $warehouse);
|
2098
|
2098
|
if($stime ) $query->where('refund_time', '>=', $stime);
|
2099
|
2099
|
if($etime ) $query->where('refund_time', '<=', $etime);
|
2100
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1);
|
|
2100
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1);
|
2101
|
2101
|
|
2102
|
2102
|
$result = $resultQuery->orderBy('refund_time','desc')->offset($offset)->limit($pageSize)->get();
|
2103
|
2103
|
|
|
@@ -2163,7 +2163,7 @@ class StatisticsController extends Controller
|
2163
|
2163
|
if($stime) $query->where('send_time', '>=', $stime);
|
2164
|
2164
|
if($etime) $query->where('send_time', '<=', $etime);
|
2165
|
2165
|
|
2166
|
|
- })->where('is_del', 0)->where('logistics_id', '>', '')->count();
|
|
2166
|
+ })->where('is_del', 0)->where('status','>=',2)->where('logistics_id', '>', '')->count();
|
2167
|
2167
|
if ($count > 1) {
|
2168
|
2168
|
// 总页数
|
2169
|
2169
|
$pages = ceil($count/$pageSize);
|
|
@@ -2178,7 +2178,7 @@ class StatisticsController extends Controller
|
2178
|
2178
|
if($warehouse) $query->where('warehouse', $warehouse);
|
2179
|
2179
|
if($stime ) $query->where('send_time', '>=', $stime);
|
2180
|
2180
|
if($etime ) $query->where('send_time', '<=', $etime);
|
2181
|
|
- })->where('is_del', 0)->where('logistics_id', '>', '');
|
|
2181
|
+ })->where('is_del', 0)->where('status','>=',2)->where('logistics_id', '>', '');
|
2182
|
2182
|
|
2183
|
2183
|
$result = $resultQuery->orderBy('send_time','desc')->offset($offset)->limit($pageSize)->get();
|
2184
|
2184
|
|
|
@@ -2228,7 +2228,7 @@ class StatisticsController extends Controller
|
2228
|
2228
|
if($warehouse) $query->where('warehouse', $warehouse);
|
2229
|
2229
|
if($stime ) $query->where('aftersale_time', '>=', $stime);
|
2230
|
2230
|
if($etime ) $query->where('aftersale_time', '<=', $etime. ' 23:59:59');
|
2231
|
|
- })->where('is_del', 0)->where('aftersale_fee', '>', 0);
|
|
2231
|
+ })->where('is_del', 0)->where('status','>=',2)->where('aftersale_fee', '>', 0);
|
2232
|
2232
|
|
2233
|
2233
|
$result = $resultQuery->orderBy('aftersale_time','desc')->get();
|
2234
|
2234
|
|
|
@@ -2269,7 +2269,7 @@ class StatisticsController extends Controller
|
2269
|
2269
|
if($warehouse) $query->where('warehouse', $warehouse);
|
2270
|
2270
|
if($stime ) $query->where('refund_time', '>=', $stime);
|
2271
|
2271
|
if($etime ) $query->where('refund_time', '<=', $etime);
|
2272
|
|
- })->where('is_del', 0)->where('refund_time', '>', '')->where('is_refund', 1);
|
|
2272
|
+ })->where('is_del', 0)->where('status','>=',2)->where('refund_time', '>', '')->where('is_refund', 1);
|
2273
|
2273
|
|
2274
|
2274
|
$result = $resultQuery->orderBy('refund_time','desc')->get();
|
2275
|
2275
|
|
|
@@ -2317,7 +2317,7 @@ class StatisticsController extends Controller
|
2317
|
2317
|
if($warehouse) $query->where('warehouse', $warehouse);
|
2318
|
2318
|
if($stime ) $query->where('send_time', '>=', $stime);
|
2319
|
2319
|
if($etime ) $query->where('send_time', '<=', $etime);
|
2320
|
|
- })->where('is_del', 0)->where('logistics_id', '>', '');
|
|
2320
|
+ })->where('is_del', 0)->where('status','>=',2)->where('logistics_id', '>', '');
|
2321
|
2321
|
|
2322
|
2322
|
$result = $resultQuery->orderBy('send_time','desc')->get();
|
2323
|
2323
|
|
|
@@ -2371,7 +2371,7 @@ class StatisticsController extends Controller
|
2371
|
2371
|
if($stime && $aftersale == 1) $query->where('aftersale_time', '>=', $stime);
|
2372
|
2372
|
if($etime && $aftersale == 1) $query->where('aftersale_time', '<=', $etime. ' 23:59:59');
|
2373
|
2373
|
if($aftersale == 1) $query->where('aftersale_fee', '>', 0);
|
2374
|
|
- })->where('is_del', 0)->groupBy('team_id')->groupBy('ctime')->get();
|
|
2374
|
+ })->where('is_del', 0)->where('status','>=',2)->groupBy('team_id')->groupBy('ctime')->get();
|
2375
|
2375
|
$count = count($count);
|
2376
|
2376
|
|
2377
|
2377
|
if ($count > 1) {
|
|
@@ -2389,14 +2389,14 @@ class StatisticsController extends Controller
|
2389
|
2389
|
if($stime) $query->where('aftersale_time', '>=', $stime);
|
2390
|
2390
|
if($etime) $query->where('aftersale_time', '<=', $etime. ' 23:59:59');
|
2391
|
2391
|
if($aftersale == 1) $query->where('aftersale_fee', '>', 0);
|
2392
|
|
- })->where('is_del', 0)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('aftersale_time','desc')->offset($offset)->limit($pageSize)->get();
|
|
2392
|
+ })->where('is_del', 0)->where('status','>=',2)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('aftersale_time','desc')->offset($offset)->limit($pageSize)->get();
|
2393
|
2393
|
}else{
|
2394
|
2394
|
$result = Order::select(DB::raw('left(createTime, 10) as ctime, team_id, count(1) as order_count, sum(receivedAmount) as receivedAmount, sum(aftersale_fee) as aftersale_fee, sum(refund_price) as refund_price, sum(cost) as cost, sum(freight_cost) as freight_cost, sum(if(payment_type=1,receivedAmount,null)) as wx_money'))->where(function($query) use($team_id, $stime, $etime, $aftersale){
|
2395
|
2395
|
if($team_id) $query->where('team_id', $team_id);
|
2396
|
2396
|
if($stime) $query->where('createTime', '>=', $stime);
|
2397
|
2397
|
if($etime) $query->where('createTime', '<=', $etime.' 23:59:59');
|
2398
|
2398
|
if($aftersale == 1) $query->where('aftersale_fee', '>', 0);
|
2399
|
|
- })->where('is_del', 0)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('createTime','desc')->offset($offset)->limit($pageSize)->get();
|
|
2399
|
+ })->where('is_del', 0)->where('status','>=',2)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('createTime','desc')->offset($offset)->limit($pageSize)->get();
|
2400
|
2400
|
}
|
2401
|
2401
|
$result = json_decode(json_encode($result), true);
|
2402
|
2402
|
foreach($result as $k=>&$v){
|
|
@@ -2438,7 +2438,7 @@ class StatisticsController extends Controller
|
2438
|
2438
|
if($stime && $aftersale == 1) $query->where('aftersale_time', '>=', $stime);
|
2439
|
2439
|
if($etime && $aftersale == 1) $query->where('aftersale_time', '<=', $etime. ' 23:59:59');
|
2440
|
2440
|
if($aftersale == 1) $query->where('aftersale_fee', '>', 0);
|
2441
|
|
- })->where('is_del', 0)->orderBy('team_id', 'asc');
|
|
2441
|
+ })->where('is_del', 0)->where('status','>=',2)->orderBy('team_id', 'asc');
|
2442
|
2442
|
if($aftersale == 1){
|
2443
|
2443
|
$result = $resultQuery->orderBy('aftersale_time','desc')->get();
|
2444
|
2444
|
}else{
|
|
@@ -2475,14 +2475,14 @@ class StatisticsController extends Controller
|
2475
|
2475
|
if($stime) $query->where('aftersale_time', '>=', $stime);
|
2476
|
2476
|
if($etime) $query->where('aftersale_time', '<=', $etime.' 23:59:59');
|
2477
|
2477
|
if($aftersale == 1) $query->where('aftersale_fee', '>', 0);
|
2478
|
|
- })->where('is_del', 0)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('aftersale_time','desc')->get();
|
|
2478
|
+ })->where('is_del', 0)->where('status','>=',2)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('aftersale_time','desc')->get();
|
2479
|
2479
|
}else{
|
2480
|
2480
|
$result = Order::select(DB::raw('left(createTime, 10) as ctime, team_id, count(1) as order_count, sum(receivedAmount) as receivedAmount, sum(aftersale_fee) as aftersale_fee, sum(refund_price) as refund_price, sum(cost) as cost, sum(freight_cost) as freight_cost, sum(if(payment_type=1,receivedAmount,null)) as wx_money'))->where(function($query) use($team_id, $stime, $etime, $aftersale){
|
2481
|
2481
|
if($team_id) $query->where('team_id', $team_id);
|
2482
|
2482
|
if($stime) $query->where('createTime', '>=', $stime);
|
2483
|
2483
|
if($etime) $query->where('createTime', '<=', $etime.' 23:59:59');
|
2484
|
2484
|
if($aftersale == 1) $query->where('aftersale_fee', '>', 0);
|
2485
|
|
- })->where('is_del', 0)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('createTime','desc')->get();
|
|
2485
|
+ })->where('is_del', 0)->where('status','>=',2)->groupBy('team_id')->groupBy('ctime')->orderBy('team_id', 'asc')->orderBy('createTime','desc')->get();
|
2486
|
2486
|
}
|
2487
|
2487
|
$result = json_decode(json_encode($result), true);
|
2488
|
2488
|
foreach($result as $k=>&$v){
|
|
@@ -3892,7 +3892,7 @@ class StatisticsController extends Controller
|
3892
|
3892
|
if($stime) $query->where('send_time', '>=', $stime);
|
3893
|
3893
|
if($etime) $query->where('send_time', '<=', $etime);
|
3894
|
3894
|
if($warehouse>0) $query->where('warehouse', '=', $warehouse);
|
3895
|
|
- })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->groupBy('warehouse')->groupBy('send_time')->get();
|
|
3895
|
+ })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->where('status','>=',2)->groupBy('warehouse')->groupBy('send_time')->get();
|
3896
|
3896
|
$count = count($count);
|
3897
|
3897
|
if ($count > 1) {
|
3898
|
3898
|
// 总页数
|
|
@@ -3907,7 +3907,7 @@ class StatisticsController extends Controller
|
3907
|
3907
|
if($stime) $query->where('send_time', '>=', $stime);
|
3908
|
3908
|
if($etime) $query->where('send_time', '<=', $etime);
|
3909
|
3909
|
if($warehouse>0) $query->where('warehouse', '=', $warehouse);
|
3910
|
|
- })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->groupBy('warehouse')->groupBy('send_time')->orderBy('send_time', 'desc')->offset($offset)->limit($pageSize)->get();
|
|
3910
|
+ })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->where('status','>=',2)->groupBy('warehouse')->groupBy('send_time')->orderBy('send_time', 'desc')->offset($offset)->limit($pageSize)->get();
|
3911
|
3911
|
|
3912
|
3912
|
$wareArr = array(
|
3913
|
3913
|
0 => '其他',
|
|
@@ -3924,7 +3924,7 @@ class StatisticsController extends Controller
|
3924
|
3924
|
if($stime) $query->where('send_time', '>=', $stime);
|
3925
|
3925
|
if($etime) $query->where('send_time', '<=', $etime);
|
3926
|
3926
|
if($warehouse>0) $query->where('warehouse', '=', $warehouse);
|
3927
|
|
- })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->first();
|
|
3927
|
+ })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->where('status','>=',2)->first();
|
3928
|
3928
|
|
3929
|
3929
|
|
3930
|
3930
|
return view('statistics/warehouseFinanceList', ['result'=>$result,
|
|
@@ -3950,7 +3950,7 @@ class StatisticsController extends Controller
|
3950
|
3950
|
if($stime) $query->where('send_time', '>=', $stime);
|
3951
|
3951
|
if($etime) $query->where('send_time', '<=', $etime);
|
3952
|
3952
|
if($warehouse>0) $query->where('warehouse', '=', $warehouse);
|
3953
|
|
- })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->groupBy('warehouse')->groupBy('send_time')->orderBy('send_time', 'desc')->get();
|
|
3953
|
+ })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->where('status','>=',2)->groupBy('warehouse')->groupBy('send_time')->orderBy('send_time', 'desc')->get();
|
3954
|
3954
|
|
3955
|
3955
|
$wareArr = array(
|
3956
|
3956
|
0 => '其他',
|