* finish task #5297.

This commit is contained in:
wangyidong
2019-02-25 14:09:57 +08:00
parent 5ed0ed92fd
commit 373aedfc0b
4 changed files with 18 additions and 9 deletions
+8 -2
View File
@@ -173,12 +173,18 @@ class treeModel extends model
/**
* Get line pairs.
*
* @param bool $useShort
* @access public
* @return array
*/
public function getLinePairs()
public function getLinePairs($useShort = false)
{
return $this->dao->select('id, name')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->fetchPairs();
$lines = $this->dao->select('id,name,short')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->fetchAll('id');
$linePairs = array();
foreach($lines as $lineID => $line) $linePairs[$lineID] = ($useShort and !empty($line->short)) ? $line->short : $line->name;
return $linePairs;
}
/**