接单成功
This commit is contained in:
parent
17d9f68255
commit
27959bda9a
|
|
@ -22,9 +22,8 @@ class CheckOrdeRecordCommand extends Command
|
|||
|
||||
protected function execute(Input $input, Output $output){
|
||||
$Model = new OrderDispatchRecord();
|
||||
$now = date('Y-m-d H:i:s'); //创建三十分名以上未接的任务
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
//$Model->where('need_notice',1)
|
||||
$Model->where('notice_time','<=',$now)
|
||||
->where('status',0)
|
||||
->chunk(100, function ($list) {
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\command;
|
||||
|
||||
use app\admin\model\OrderDispatch;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
use think\Hook;
|
||||
|
||||
class CheckOrderDispatchCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('check:dispatch-overtime')
|
||||
->setDescription('检测dispatch表超时任务,每分钟检测一次');
|
||||
}
|
||||
|
||||
protected function execute(Input $input, Output $output){
|
||||
|
||||
$Model = new OrderDispatch();
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
$Model->where('status',OrderDispatch::STATUS_PLANIT)
|
||||
->where('plan_time','<=',$now)
|
||||
->chunk(100, function ($list) {
|
||||
foreach ($list as $item) {
|
||||
//1修改为超时
|
||||
$item->status = OrderDispatch::STATUS_OVERTIME;
|
||||
$item->save();
|
||||
$params = ['dispatch'=>$item,'remark'=>'系统自动检测,任务超时'];
|
||||
Hook::listen('order_dispatch_change',$params);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$output->info('OVER');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@ class CheckTTSPlantCommand extends Command
|
|||
$now = date('Y-m-d H:i:s'); //两小时通知
|
||||
$afterTwoHours = date('Y-m-d H:i:s', strtotime('+1 hours'));
|
||||
|
||||
//$Model->where('need_notice',1)
|
||||
$Model->where('status','=',OrderDispatch::STATUS_PLANIT)
|
||||
->where('plan_time','between',[$now,$afterTwoHours])
|
||||
->where('tts_notice','<',2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user