This commit is contained in:
xman 2025-06-06 16:47:15 +08:00
parent c9944b8b07
commit 495c0e3f33
3 changed files with 6 additions and 5 deletions

View File

@ -44,7 +44,7 @@ class OrderDispatchLog
'dispatch_id' => $dispatch->id, 'dispatch_id' => $dispatch->id,
'type' => 1, 'type' => 1,
'outid' => md5(time().rand(1000,9999).rand(1000,9999)), 'outid' => md5(time().rand(1000,9999).rand(1000,9999)),
'craate_time' => date('Y-m-d H:i:s'), 'create_time' => date('Y-m-d H:i:s'),
'status' => $alibaba_dyvms['sync']?1:0 'status' => $alibaba_dyvms['sync']?1:0
]; ];
$service = new NoticeLogic(); $service = new NoticeLogic();

View File

@ -69,8 +69,10 @@ class CheckOrderDispatchGotCommand extends Command
//预约时间过了未上门检测 //预约时间过了未上门检测
private function _toarrive(){ private function _toarrive(){
try { try {
//自动派单,改为待跟进
$Model = new OrderDispatch(); $Model = new OrderDispatch();
$now = date('Y-m-d H:i:s', time() - 5 * 60); //创建三十分名以上未接的任务 $now = date('Y-m-d H:i:s');
$count = $Model->whereIn('status', [OrderDispatch::STATUS_PLANIT,OrderDispatch::STATUS_OVERTIME]) $count = $Model->whereIn('status', [OrderDispatch::STATUS_PLANIT,OrderDispatch::STATUS_OVERTIME])
->where('type', 2) ->where('type', 2)
->where('follow', 1) ->where('follow', 1)

View File

@ -21,7 +21,7 @@ class CheckSmsPlantCommand extends Command
protected function execute(Input $input, Output $output){ protected function execute(Input $input, Output $output){
$Model = new OrderDispatch(); $Model = new OrderDispatch();
$now = date('Y-m-d H:i:s'); //两小时通知 $now = date('Y-m-d H:i:s'); //提前两小时通知
$afterTwoHours = date('Y-m-d H:i:s', strtotime('+2 hours')); $afterTwoHours = date('Y-m-d H:i:s', strtotime('+2 hours'));
$Model->whereIn('status',[OrderDispatch::STATUS_PLANIT,OrderDispatch::STATUS_OVERTIME]) $Model->whereIn('status',[OrderDispatch::STATUS_PLANIT,OrderDispatch::STATUS_OVERTIME])
->where('plan_time','between',[$now,$afterTwoHours]) ->where('plan_time','between',[$now,$afterTwoHours])
@ -32,7 +32,7 @@ class CheckSmsPlantCommand extends Command
$ids[] = $item->id; $ids[] = $item->id;
try { try {
SendMailLogic::sendToWorker($item->worker_tel); SendMailLogic::sendToWorker($item->worker_tel);
echo '短信发送完成:'.$item->id.PHP_EOL;
}catch (Exception $exception){ }catch (Exception $exception){
echo '短信发送失败:'.$exception->getMessage().PHP_EOL; echo '短信发送失败:'.$exception->getMessage().PHP_EOL;
@ -43,7 +43,6 @@ class CheckSmsPlantCommand extends Command
'create_time' => date('Y-m-d H:i:s', time()) 'create_time' => date('Y-m-d H:i:s', time())
]); ]);
} }
echo '短信发送完成:'.$item->id.PHP_EOL;
} }
if(!empty($ids)){ if(!empty($ids)){
OrderDispatch::whereIn('id',$ids)->update(['notice_num'=>3,'notice_time'=>date('Y-m-d H:i:s')]); OrderDispatch::whereIn('id',$ids)->update(['notice_num'=>3,'notice_time'=>date('Y-m-d H:i:s')]);