Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
44ae2a7487
@ -105,7 +105,7 @@ class TaskTemplateController extends BaseAdminController
|
||||
$params = (new TaskTemplateValidate())->post()->goCheck('delete');
|
||||
$task = Task::where(['template_id' =>$params['id']])->whereDay('start_time', 'today')->find();
|
||||
if(!empty($task)) {
|
||||
$this->fail('该任务今天已在进行中,无法删除');
|
||||
return $this->fail('该任务今天已在进行中,无法删除');
|
||||
}
|
||||
TaskTemplateLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
@ -140,4 +140,29 @@ class TaskTemplateController extends BaseAdminController
|
||||
];
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
public function checkRole()
|
||||
{
|
||||
$params = $this->request->param();
|
||||
if ($params['task_role'] == 1) {
|
||||
$serviceManagerUser = (new User())->searchMaster($params['company_id']);
|
||||
if (empty($serviceManagerUser)) {
|
||||
return $this->fail('公司还没有负责人,无法指派任务');
|
||||
}
|
||||
}
|
||||
if ($params['task_role'] == 2) {
|
||||
$serviceManagerUser = (new User())->searchMarketingManager($params['company_id']);
|
||||
if (empty($serviceManagerUser)) {
|
||||
return $this->fail('公司还没有市场部长,无法指派任务');
|
||||
}
|
||||
}
|
||||
|
||||
if ($params['task_role'] == 3) {
|
||||
$serviceManagerUser = (new User())->searchServiceManager($params['company_id']);
|
||||
if (empty($serviceManagerUser)) {
|
||||
return $this->fail('公司还没有服务部长,无法指派任务');
|
||||
}
|
||||
}
|
||||
return $this->success('成功');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user