* Code for task #7825.

This commit is contained in:
Yagami
2020-09-07 14:18:32 +08:00
parent d63e8916ea
commit 11bc9076ac
14 changed files with 136 additions and 51 deletions
+3 -2
View File
@@ -77,14 +77,15 @@ class programModel extends model
*/
public function getProgramOverview($queryType = 'byStatus', $param = 'all', $orderBy = 'id_desc', $limit = 15)
{
$queryType = strtolower($queryType);
$programs = $this->dao->select('*')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
->andWhere('template')->ne('')
->andWhere('program')->eq(0)
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->beginIF($queryType == 'byStatus' and $param != 'all')->andWhere('status')->eq($param)->fi()
->beginIF($queryType == 'byId')->andWhere('id')->eq($param)->fi()
->beginIF($queryType == 'bystatus' and $param != 'all')->andWhere('status')->eq($param)->fi()
->beginIF($queryType == 'byid')->andWhere('id')->eq($param)->fi()
->orderBy($orderBy)
->limit($limit)
->fetchAll('id');