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;