Skip to content

Commit

Permalink
feat: 限制个人最多500个未完成任务
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Jan 6, 2022
1 parent 840374c commit 6b3513c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Models/ProjectTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public function scopeAllData($query, $userid = null)
}

/**
* 查询自己参与或负责的任务
* 查询自己负责或参与的任务
* @param self $query
* @param null $userid
* @param null $owner
Expand Down Expand Up @@ -379,6 +379,12 @@ public static function addTask($data)
if (!ProjectUser::whereProjectId($project_id)->whereUserid($uid)->exists()) {
throw new ApiException($retPre . '负责人填写错误');
}
if (ProjectTask::authData($uid)
->whereNull('project_tasks.complete_at')
->whereNull('project_tasks.archived_at')
->count() > 500) {
throw new ApiException(User::userid2nickname($uid) . '负责或参与的任务超过500个未完成');
}
$tmpArray[] = $uid;
}
$owner = $tmpArray;
Expand Down

0 comments on commit 6b3513c

Please sign in to comment.