* Optimize code.

This commit is contained in:
liumengyi
2023-02-01 16:42:47 +08:00
parent 15de44ff01
commit c628ee2b4b
+2 -2
View File
@@ -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)