This commit is contained in:
xman 2025-06-04 13:35:32 +08:00
parent 10412e6596
commit eae143512f

View File

@ -31,8 +31,14 @@ class CheckOrdeRecordCommand extends Command
foreach ($list as $item) {
$ids[] = $item->id;
$dispatchIds[] = $item->dispatch_id;
$existDispatchIds = [];
//修改状态
if($item->need_notice == 1){ //需要通知
if(in_array($item->dispatch_id,$existDispatchIds)){
continue;
}
$dispatch = OrderDispatch::get($item->dispatch_id,['orderb']);
Message::create([
'to_id' => $dispatch->admin_id,
@ -40,6 +46,8 @@ class CheckOrdeRecordCommand extends Command
'title' => '派单任务跟进提示',
'content' => '【订单跟进提示】您有一条待跟进订单,订单编号:'.$dispatch->orderb->order_no.',请及时关注。'
]);
$existDispatchIds[] = $item->dispatch_id;
}
}
OrderDispatchRecord::whereIn('id',$ids)->where('status',0)->update(['status'=>1]);