更新
This commit is contained in:
parent
0a247681fb
commit
b11b8fa387
@ -189,21 +189,21 @@ class Statistics extends BaseController
|
||||
if (!isset($parmas['goods_id']) || $parmas['goods_id'] == '') {
|
||||
return app('json')->fail('goods_id:格式错误');
|
||||
}
|
||||
// if (isset($parmas['responsible_area']) && $parmas['responsible_area'] != '') {
|
||||
// $area[] = ['street_id','in',explode(',', $parmas['responsible_area'])];
|
||||
// }else{
|
||||
// return app('json')->fail('responsible_area:格式错误');
|
||||
// }
|
||||
// $merchant=Db::name('merchant')->where('street_id','in',$area)->select();
|
||||
// if(!$merchant){
|
||||
// return app('json')->fail('查询商户为空');
|
||||
// }
|
||||
if (isset($parmas['responsible_area']) && $parmas['responsible_area'] != '') {
|
||||
$area[] = ['street_id','in',explode(',', $parmas['responsible_area'])];
|
||||
}else{
|
||||
return app('json')->fail('responsible_area:格式错误');
|
||||
}
|
||||
$merchant=Db::name('merchant')->where($area)->column('mer_id');
|
||||
if(!$merchant){
|
||||
return app('json')->fail('查询商户为空');
|
||||
}
|
||||
$where[]=['p.create_time','between time',[date("Y-m-d H:i:s",$parmas['start_time']),date("Y-m-d H:i:s",$parmas['end_time'])]];
|
||||
$where[] = ['p.product_id','in',explode(',', $parmas['goods_id'])];
|
||||
$where[] = ['p.is_refund','=',0];
|
||||
$count=Db::name('store_order_product')->alias('p')
|
||||
->where($where)
|
||||
// ->join('store_order o','o.mer_id in '.$parmas['mer_intention_id'].' and o.paid=1 and o.is_del=0')
|
||||
->join('store_order o','o.mer_id in ('.implode(',',$merchant).') and o.paid=1 and o.is_del=0')
|
||||
->sum('p.total_price');
|
||||
return app('json')->success(['procure_amount'=>$count]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user