* Code for task #110544.

This commit is contained in:
wangyidong
2024-01-18 14:00:42 +08:00
parent 71478f1781
commit 2c2ed981cc
5 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -265,7 +265,7 @@ class executionModel extends model
->autoCheck('begin,end')
->batchCheck($this->config->execution->create->requiredFields, 'notempty')
->checkIF(!empty($execution->name), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = " . (int)$execution->project . " and `deleted` = '0'")
->checkIF(!empty($execution->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban') and `deleted` = '0'")
->checkIF(!empty($execution->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = " . (int)$execution->project . " and `deleted` = '0'")
->checkIF($execution->begin != '', 'begin', 'date')
->checkIF($execution->end != '', 'end', 'date')
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
@@ -398,7 +398,7 @@ class executionModel extends model
->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->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `deleted` = '0'")
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = '$executionProject' and `deleted` = '0'")
->checkFlow()
->where('id')->eq($executionID)
->limit(1)
@@ -684,7 +684,7 @@ class executionModel extends model
->checkIF($execution->end != '', 'end', 'date')
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID and type in ('sprint','stage','kanban') and `project` = $projectID and `deleted` = '0'")
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage','kanban') and `deleted` = '0'")
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage','kanban') and `project` = $projectID and `deleted` = '0'")
->checkFlow()
->where('id')->eq($executionID)
->limit(1)
+1 -1
View File
@@ -347,7 +347,7 @@ class productModel extends model
$this->lang->error->unique = $this->lang->error->repeat;
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
->checkIF(!empty($product->name), 'name', 'unique', "`program` = {$product->program} AND `deleted` = '0'")
->checkIF(!empty($product->code), 'code', 'unique', "`deleted` = '0'")
->checkIF(!empty($product->code), 'code', 'unique', "`program` = {$product->program} AND `deleted` = '0'")
->batchCheck($this->config->product->create->requiredFields, 'notempty')
->checkFlow()
->exec();
+1 -1
View File
@@ -405,7 +405,7 @@ class productTao extends productModel
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()
->checkIF(!empty($product->name), 'name', 'unique', "id != {$productID} and `program` = {$programID} and `deleted` = '0'")
->checkIF(!empty($product->code), 'code', 'unique', "id != {$productID} and `deleted` = '0'")
->checkIF(!empty($product->code), 'code', 'unique', "id != {$productID} and `program` = {$programID} and `deleted` = '0'")
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
->checkFlow()
->where('id')->eq($productID)
+1 -1
View File
@@ -69,7 +69,7 @@ class programplanTao extends programplanModel
$this->dao->update(TABLE_PROJECT)->data($plan)->autoCheck()
->checkIF(!empty($plan->name) && $getName, 'name', 'unique', "id in ({$relatedIdList}) and type in ('sprint','stage') and `project` = {$oldPlan->project} and `deleted` = '0' and `parent` = {$oldPlan->parent}")
->checkIF(!empty($plan->code) && $setCode, 'code', 'unique', "id != {$planID} and type in ('sprint','stage','kanban') and `deleted` = '0'")
->checkIF(!empty($plan->code) && $setCode, 'code', 'unique', "id != {$planID} and type in ('sprint','stage','kanban') and `project` = {$oldPlan->project} and `deleted` = '0' and `parent` = {$oldPlan->parent}")
->where('id')->eq($planID)
->exec();
+3 -3
View File
@@ -111,7 +111,7 @@ class projectTao extends projectModel
->autoCheck('begin,end')
->check('end', 'gt', $project->begin)
->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = '$project->parent' and `model` = " . $this->dao->sqlobj->quote($project->model) . " and `deleted` = '0'")
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type` = 'project' and `model` = " . $this->dao->sqlobj->quote($project->model) . " and `deleted` = '0'")
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type` = 'project' and `parent` = '$project->parent' and `model` = " . $this->dao->sqlobj->quote($project->model) . " and `deleted` = '0'")
->checkFlow()
->where('id')->eq($projectID)
->exec();
@@ -133,8 +133,8 @@ class projectTao extends projectModel
$this->dao->insert(TABLE_PROJECT)->data($project)
->autoCheck()
->batchCheck($this->config->project->create->requiredFields, 'notempty')
->checkIF(!empty($project->name), 'name', 'unique', "`type`='project' and `parent` = " . $this->dao->sqlobj->quote($project->parent) . " and `model` = " . $this->dao->sqlobj->quote($project->model) . " and `deleted` = '0'")
->checkIF(!empty($project->code), 'code', 'unique', "`type`='project' and `model` = " . $this->dao->sqlobj->quote($project->model) . " and `deleted` = '0'")
->checkIF(!empty($project->name), 'name', 'unique', "`type`='project' and `parent` = " . $this->dao->sqlobj->quote($project->parent) . " and `model` = " . $this->dao->sqlobj->quote($project->model) . " and `deleted` = '0'")
->checkIF(!empty($project->code), 'code', 'unique', "`type`='project' and `parent` = " . $this->dao->sqlobj->quote($project->parent) . " and `model` = " . $this->dao->sqlobj->quote($project->model) . " and `deleted` = '0'")
->checkIF($project->end != '', 'end', 'gt', $project->begin)
->checkFlow()
->exec();