From c628ee2b4b0d96570b57f9ad4f0bb0529bb76157 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 1 Feb 2023 16:42:47 +0800 Subject: [PATCH] * Optimize code. --- module/execution/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 91023c612d..b5748b101e 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -593,7 +593,7 @@ class executionModel extends model } $relatedExecutionsID = $this->getRelatedExecutions($executionID); - $relatedExecutionsID = !empty($relatedExecutionsID) ? implode("','", array_keys($relatedExecutionsID)) : ''; + $relatedExecutionsID = !empty($relatedExecutionsID) ? implode(',', array_keys($relatedExecutionsID)) : ''; /* Update data. */ $this->lang->error->unique = $this->lang->error->repeat; @@ -604,7 +604,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) - ->checkIF(!empty($execution->name), 'name', 'unique', "id in ('$relatedExecutionsID') and type in ('sprint','stage', 'kanban') and `project` = '$executionProject' and `deleted` = '0'") + ->checkIF(!empty($execution->name), 'name', 'unique', "id in ($relatedExecutionsID) and type in ('sprint','stage', 'kanban') and `project` = '$executionProject' and `deleted` = '0'") ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `deleted` = '0'") ->checkFlow() ->where('id')->eq($executionID)