* adjust for getParentPairs with template.

This commit is contained in:
z
2020-08-25 16:38:17 +08:00
parent 843e2f8579
commit 9a11ace11e
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -489,9 +489,15 @@ class programModel extends model
* @access public
* @return array
*/
public function getParentPairs()
public function getParentPairs($template = '')
{
$modules = $this->dao->select('id,name,parent,path,grade')->from(TABLE_PROJECT)->where('isCat')->eq(1)->andWhere('deleted')->eq(0)->orderBy('grade desc, `order`')->fetchAll('id');
$modules = $this->dao->select('id,name,parent,path,grade')->from(TABLE_PROJECT)
->where('isCat')->eq(1)
->andWhere('deleted')->eq(0)
->andWhere('template')->ne('')
->beginIF($template)->andWhere('template')->eq($template)->fi()
->orderBy('grade desc, `order`')
->fetchAll('id');
$treeMenu = array();
foreach($modules as $module)