* Fix code logic.

This commit is contained in:
Yagami
2019-11-27 17:14:09 +08:00
parent 4e4281927a
commit 97bae2e030
2 changed files with 5 additions and 8 deletions
+1 -1
View File
@@ -964,7 +964,7 @@ class testtask extends control
->andWhere('t2.status')->ne('wait')
->fetchGroup('case', 'id');
$this->view->caseIDList = $caseIDList;
$this->view->caseIDList = array_keys($cases);
$this->view->productID = $productID;
$this->view->title = $this->lang->testtask->batchRun;
$this->view->position[] = $this->lang->testtask->common;
+4 -7
View File
@@ -39,24 +39,21 @@ class treeModel extends model
->beginIF($type == 'bug')->orWhere('type')->eq('bug')->fi()
->beginIF($type == 'case')->orWhere('type')->eq('case')->fi()
->andWhere('deleted')->eq('0')
->orderBy('grade asc')
->fetchAll();
$pairs = array();
$pairs[0] = '/';
foreach($modules as $module)
{
if($module->parent == '0')
if($module->grade == 1)
{
$pairs[$module->id] = '/' . $module->name;
continue;
}
$path = substr($module->path, 1, -1);
$relatedModules = $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in($path)->orderBy('grade')->fetchPairs();
$modulePath = '';
foreach($relatedModules as $moduleName) $modulePath .= '/' . $moduleName;
$pairs[$module->id] = $modulePath;
$moduleName = '/' . $module->name;
$pairs[$module->id] = isset($pairs[$module->parent]) ? $pairs[$module->parent] . $moduleName : $moduleName;
}
return $pairs;