*Code for code review.

This commit is contained in:
songchenxuan
2022-01-06 13:08:46 +08:00
parent 6d80b334bf
commit 8927059720
11 changed files with 50 additions and 17 deletions
+3 -3
View File
@@ -242,8 +242,8 @@ class treeModel extends model
public function getTaskOptionMenu($rootID, $productID = 0, $startModule = 0, $extra = '')
{
/* If createdVersion <= 4.1, go to getOptionMenu(). */
$products = $this->loadModel('product')->getProductPairsByProject($rootID);
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
$products = $this->loadModel('product')->getProductPairsByProject($rootID);
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
if(!$this->isMergeModule($rootID, 'task') or !$products) return $this->getOptionMenu($rootID, 'task', $startModule);
@@ -282,7 +282,7 @@ class treeModel extends model
{
$modules = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = '" . (int)$rootID . "' and type = 'task' and parent != 0) OR (root = $id and type = 'story'))")
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
->beginIF(!empty($activeBranch))->andWhere('branch')->in($activeBranch)->fi()
->andWhere('branch')->in($activeBranch)->fi()
->andWhere('deleted')->eq(0)
->orderBy('grade desc, branch, `order`, type')
->fetchAll('id');