Update
parent
fc303f26f6
commit
aa722e553f
|
|
@ -32,10 +32,13 @@ class OrderAutoAllocate extends Command
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
do {
|
||||
$page = 0;
|
||||
|
||||
DealerOrder::where('status', DealerOrderStatus::Pending)
|
||||
->where('consignor_id', '>', 1)//到1用户或者公司的订单不需要再分配
|
||||
->where('consignor_id', '>', 1) // 到1用户或者公司的订单不需要再分配
|
||||
->where('allocated_at', '<', now()->subMinutes(app_settings('dealer.order_auto_allocate_times')))
|
||||
->chunkById(200, function ($orders) {
|
||||
->chunkById(200, function ($orders) use (&$page) {
|
||||
$orders->load([
|
||||
'consignor',
|
||||
]);
|
||||
|
|
@ -50,8 +53,17 @@ class OrderAutoAllocate extends Command
|
|||
report($th);
|
||||
}
|
||||
}
|
||||
|
||||
$page++;
|
||||
});
|
||||
|
||||
if ($page > 1) {
|
||||
sleep(15);
|
||||
} else {
|
||||
sleep(60);
|
||||
}
|
||||
} while (true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue