This commit is contained in:
lewis 2025-01-10 14:21:47 +08:00
commit 54d5f6eb0f
2 changed files with 33 additions and 24 deletions

View File

@ -955,6 +955,13 @@ class BeforehandOrderLogic extends BaseLogic
public static function statisticsCount($params)
{
$where = [];
$where2 = [];
if($params['store_id']>0){
$where2[] = ['store_id', '=', $params['store_id']];
}
if($params['start_time']!=''&& $params['end_time']!=''){
$where2[] = ['create_time', 'between', [strtotime($params['start_time']), strtotime($params['end_time'])]];
}
if ($params['warehouse_type'] > 0) {
switch ($params['warehouse_type']) {
case 1:
@ -975,30 +982,31 @@ class BeforehandOrderLogic extends BaseLogic
}
}
$orderCounts = BeforehandOrder::where('order_type', 'in', [1, 2, 3, 4, 5, 7, 8])
->where($where2)
->group('order_type')
->where(['order_type', Db::raw('count(*) as count')])
->column('count', 'order_type');
d($orderCounts);
$order_type_1 = BeforehandOrder::where([['order_type', '=', 1]])->count();
$order_type_2 = BeforehandOrder::where([['order_type', '=', 2]])->count();
$order_type_3 = BeforehandOrder::where([['order_type', '=', 3]])->count();
$order_type_4 = BeforehandOrder::where([['order_type', '=', 4]])->count();
$order_type_5 = BeforehandOrder::where([['order_type', '=', 5]])->count();
$order_type_7 = BeforehandOrder::where([['order_type', '=', 7]])->count();
$order_type_8 = BeforehandOrder::where([['order_type', '=', 8]])->count();
$outbound_0 = BeforehandOrder::where([['is_outbound', '=', 0], ['order_type', '<>', 5]])->count();
$outbound_1 = BeforehandOrder::where([['is_outbound', '=', 1]])->count();
$warehousing_0 = BeforehandOrder::where([['is_warehousing', '=', 0]])->count();
$warehousing_1 = BeforehandOrder::where([['is_warehousing', '=', 1]])->count();
return [
'outbound_0' => $outbound_0,
'outbound_1' => $outbound_1,
'warehousing_0' => $warehousing_0,
'warehousing_1' => $warehousing_1,
->field([Db::raw('count(*) as count'),'order_type'])->select();
$outbound_0 = BeforehandOrder::where([['is_outbound', '=', 0], ['order_type', '<>', 5]])->where($where2)->count();
$outbound_1 = BeforehandOrder::where([['is_outbound', '=', 1]])->where($where2)->count();
$warehousing_0 = BeforehandOrder::where([['is_warehousing', '=', 0]])->where($where2)->count();
$warehousing_1 = BeforehandOrder::where([['is_warehousing', '=', 1]])->where($where2)->count();
$data=[
'order_type_1' =>0,
'order_type_2'=>0,
'order_type_3'=>0,
'order_type_4'=>0,
'order_type_5'=>0,
'order_type_7'=>0,
'order_type_8'=>0
];
foreach ($orderCounts as $k => $v) {
$data['order_type'.'_'.$v['order_type']] =$v['count'] ;
}
$data['outbound_0'] = $outbound_0;
$data['outbound_1'] = $outbound_1;
$data['warehousing_0'] = $warehousing_0;
$data['warehousing_1'] = $warehousing_1;
return $data;
}
}

View File

@ -652,7 +652,8 @@ class PayNotifyLogic extends BaseLogic
if ($order['uid'] != 1) {
Redis::send('order_wetcha_push_send', ['order' => $order]);
}
if($order['store_id']==21){
$xprinter=DictData::where('type_value','xprinter')->where('name','xprinter_'.$order['store_id'])->where('status',1)->find();
if($xprinter){
Redis::send('order_xprinter_push_send', ['order' => $order]);
}
} catch (\Exception $e) {