* Fix bug#26389,26333,26328

This commit is contained in:
曾刚
2022-08-12 08:17:54 +00:00
committed by 王怡栋
parent d32cf5d6e2
commit de80b35803
4 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -396,7 +396,7 @@ class executionModel extends model
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
->autoCheck($skipFields = 'begin,end')
->batchcheck($this->config->execution->create->requiredFields, 'notempty')
->checkIF((!empty($sprint->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject and `deleted` = '0'")
->checkIF(!empty($sprint->name), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject and `deleted` = '0'")
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban') and `deleted` = '0'")
->checkIF($sprint->begin != '', 'begin', 'date')
->checkIF($sprint->end != '', 'end', 'date')
@@ -551,7 +551,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) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject and `deleted` = '0'")
->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID 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)
+3 -3
View File
@@ -680,7 +680,7 @@ class productModel extends model
$programID = isset($product->program) ? $product->program : 0;
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
->batchCheck($this->config->product->create->requiredFields, 'notempty')
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID and `deleted` = '0'")
->checkIF(!empty($product->name), 'name', 'unique', "`program` = $programID and `deleted` = '0'")
->checkIF(!empty($product->code), 'code', 'unique', "`deleted` = '0'")
->checkFlow()
->exec();
@@ -770,10 +770,10 @@ class productModel extends model
$this->lang->error->unique = $this->lang->error->repeat;
$product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->edit['id'], $this->post->uid);
$programID = isset($product->program) ? $product->program : '';
$programID = isset($product->program) ? $product->program : 0;
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID and `deleted` = '0'")
->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'")
->checkFlow()
->where('id')->eq($productID)
+2 -1
View File
@@ -231,10 +231,11 @@ class search extends control
$pager = new pager(0, $this->config->search->recPerPage, $pageID);
$results = $this->search->getList($words, $type, $pager);
$typeCount = $this->search->getListCount('');
$typeCount = $this->search->getListCount();
$typeList = array('all' => $this->lang->search->modules['all']);
foreach($typeCount as $objectType => $count)
{
if(!isset($this->lang->search->modules[$objectType])) continue;
$typeList[$objectType] = $this->lang->search->modules[$objectType];
}
+1 -1
View File
@@ -647,7 +647,7 @@ class searchModel extends model
* @access public
* @return array
*/
public function getListCount($keywords, $type = 'all')
public function getListCount($keywords = '', $type = 'all')
{
list($words, $againstCond, $likeCondition, $allowedObject) = $this->getSqlParams($keywords, $type);