From 2e75e6ffb6611f1861c5bc96791ff6bd052280e0 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 7 Jan 2022 23:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=99=90=E5=88=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=B4=9F=E8=B4=A3=E4=BA=BA=E3=80=81=E5=8D=8F=E5=8A=A9?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=AF=8F=E9=A1=B9=E6=9C=80=E5=A4=9A=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E8=B6=85=E8=BF=8710=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ProjectTask.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Models/ProjectTask.php b/app/Models/ProjectTask.php index b0d521fb..9ffb860a 100644 --- a/app/Models/ProjectTask.php +++ b/app/Models/ProjectTask.php @@ -502,6 +502,9 @@ class ProjectTask extends AbstractModel $count = $this->taskUser->count(); $array = []; $owner = is_array($data['owner']) ? $data['owner'] : [$data['owner']]; + if (count($owner) > 10) { + throw new ApiException('任务负责人最多不能超过10个'); + } foreach ($owner as $uid) { if (intval($uid) == 0) continue; if (!$this->project->useridInTheProject($uid)) continue; @@ -578,6 +581,9 @@ class ProjectTask extends AbstractModel if (Arr::exists($data, 'assist')) { $array = []; $assist = is_array($data['assist']) ? $data['assist'] : [$data['assist']]; + if (count($assist) > 10) { + throw new ApiException('任务协助人员最多不能超过10个'); + } foreach ($assist as $uid) { if (intval($uid) == 0) continue; if (!$this->project->useridInTheProject($uid)) continue;