* Finish task #43169.

This commit is contained in:
tianshujie
2021-10-14 09:24:16 +08:00
parent e5132dcc3e
commit f5e1ceb880
9 changed files with 84 additions and 48 deletions
+3 -1
View File
@@ -45,15 +45,17 @@ class programModel extends model
* Get program pairs.
*
* @param bool $isQueryAll
* @param string $orderBy
* @access public
* @return array
*/
public function getPairs($isQueryAll = false)
public function getPairs($isQueryAll = false, $orderBy = 'id_desc')
{
return $this->dao->select('id, name')->from(TABLE_PROGRAM)
->where('type')->eq('program')
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin and !$isQueryAll)->andWhere('id')->in($this->app->user->view->programs)->fi()
->orderBy($orderBy)
->fetchPairs();
}