From ad2b456f07f8837b3f04fa248da391d1d14ed928 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 27 Jun 2022 10:17:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=BB=E5=8A=A1=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=91=A8=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ProjectTask.php | 7 +++++++ app/Module/Base.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Models/ProjectTask.php b/app/Models/ProjectTask.php index 1d1f1518b..a93936c16 100644 --- a/app/Models/ProjectTask.php +++ b/app/Models/ProjectTask.php @@ -770,6 +770,7 @@ class ProjectTask extends AbstractModel // 以下紧顶级任务可修改 if ($this->parent_id === 0) { // 重复周期 + $loopAt = $this->loop_at; if (Arr::exists($data, 'loop')) { $this->loop = $data['loop']; if (!$this->refreshLoop()) { @@ -779,6 +780,11 @@ class ProjectTask extends AbstractModel // 更新任务时间也要更新重复周期 $this->refreshLoop(); } + if ($loopAt !== $this->loop_at) { + $this->addLog("修改{任务}重复周期", [ + 'change' => [$loopAt, $this->loop_at] + ]); + } // 协助人员 if (Arr::exists($data, 'assist')) { $array = []; @@ -916,6 +922,7 @@ class ProjectTask extends AbstractModel if (Base::isNumber($this->loop)) { $this->loop_at = $base->addDays($this->loop); } else { + $this->loop_at = null; $success = false; } break; diff --git a/app/Module/Base.php b/app/Module/Base.php index 3dc964b93..35d575029 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -1011,7 +1011,7 @@ class Base */ public static function isNumber($str) { - if (preg_match("/^\d*$/", $str)) { + if (preg_match("/^\d+$/", $str)) { return true; } else { return false;