This commit is contained in:
lanzongjun
2022-11-22 16:49:32 +08:00
parent 284b748e7a
commit 1d4a337af8
5 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -1086,15 +1086,15 @@ class programplanModel extends model
$this->lang->project->name = $this->lang->programplan->name;
$this->lang->project->code = $this->lang->execution->code;
$relationExecutionsID = $this->loadModel('execution')->getRelatedExecutions($planID);
$relationExecutionsID = !empty($relationExecutionsID) ? implode(',', array_keys($relationExecutionsID)) : '';
$relatedExecutionsID = $this->loadModel('execution')->getRelatedExecutions($planID);
$relatedExecutionsID = !empty($relatedExecutionsID) ? implode(',', array_keys($relatedExecutionsID)) : '';
$this->dao->update(TABLE_PROJECT)->data($plan)
->autoCheck()
->batchCheck($this->config->programplan->edit->requiredFields, 'notempty')
->checkIF($plan->end != '0000-00-00', 'end', 'ge', $plan->begin)
->checkIF($plan->percent != false, 'percent', 'float')
->checkIF(!empty($plan->name), 'name', 'unique', "id in ('{$relationExecutionsID}') and type in ('sprint','stage') and `project` = {$oldPlan->project} and `deleted` = '0'" . ($parentStage ? " and `parent` = {$oldPlan->parent}" : ''))
->checkIF(!empty($plan->name), 'name', 'unique', "id in ('{$relatedExecutionsID}') and type in ('sprint','stage') and `project` = {$oldPlan->project} and `deleted` = '0'" . ($parentStage ? " and `parent` = {$oldPlan->parent}" : ''))
->checkIF(!empty($plan->code) and $setCode, 'code', 'unique', "id != $planID and type in ('sprint','stage','kanban') and `deleted` = '0'")
->where('id')->eq($planID)
->exec();