fixed 后台在任务运行中删除了任务模板,导致结算出现异常
This commit is contained in:
parent
0c54ba8c34
commit
13ae414917
@ -22,6 +22,7 @@ use app\common\logic\ShopRequestLogic;
|
||||
use app\common\logic\task_template\TaskTemplateLogic;
|
||||
use app\adminapi\validate\task_template\TaskTemplateValidate;
|
||||
use app\common\model\Company;
|
||||
use app\common\model\task\Task;
|
||||
|
||||
|
||||
/**
|
||||
@ -102,6 +103,10 @@ class TaskTemplateController extends BaseAdminController
|
||||
public function delete()
|
||||
{
|
||||
$params = (new TaskTemplateValidate())->post()->goCheck('delete');
|
||||
$task = Task::where(['template_id' =>$params['id']])->whereDay('start_time', 'today')->find();
|
||||
if(!empty($task)) {
|
||||
$this->fail('该任务今天已在进行中,无法删除');
|
||||
}
|
||||
TaskTemplateLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user