setName('cancel_dispatch') ->setDescription('派单5分钟未领取的工单自动取消'); } protected function execute(Input $input, Output $output) { $this->cancelDispatch(); } /* * 超过5分钟未领取工单的,取消分配 */ protected function cancelDispatch() { ServiceWork::where('work_status',1) ->where('dispatch_time','<',strtotime('-5 minutes')) ->update([ 'master_worker_id' => 0, 'work_status' => 0, 'dispatch_time' => 0, 'first_contact_time' => 0, 'estimated_finish_time' => 0, ]); } }