优化指派任务逻辑

Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
vilson 2019-01-24 17:52:57 +08:00
parent 4a71d922a2
commit 990200e0b8

View File

@ -33,7 +33,10 @@ class TaskMember extends CommonModel
}
$currentMember = getCurrentMember();
$taskExecutor = self::where(['is_executor' => 1, 'task_code' => $taskCode])->find(); //原执行者
if ($taskExecutor['member_code'] == $memberCode) {
//已经是本人
return true;
}
self::update(['is_executor' => 0], ['task_code' => $taskCode]);
if ($memberCode) {
$hasJoined = self::where(['member_code' => $memberCode, 'task_code' => $taskCode])->find();