* Adjust the GetList method of the program module.

This commit is contained in:
leiyong
2020-09-09 10:19:47 +08:00
parent 9362e200b1
commit c7594b8f4a
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -421,7 +421,7 @@ class my extends control
$this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->myProgram;
$this->view->position[] = $this->lang->my->myProgram;
$this->view->programs = $this->program->getList($status, $orderBy, $pager, true);
$this->view->programs = $this->program->getList($status, $orderBy, $pager, true, true);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->pager = $pager;
$this->view->status = $status;
+3 -2
View File
@@ -8,10 +8,11 @@ class programModel extends model
* @param varchar $orderBy
* @param object $pager
* @param bool $includeCat
* @param bool $mine
* @access public
* @return array
*/
public function getList($status = 'all', $orderBy = 'id_desc', $pager = NULL, $includeCat = false)
public function getList($status = 'all', $orderBy = 'id_desc', $pager = NULL, $includeCat = false, $mine = false)
{
return $this->dao->select('*')->from(TABLE_PROJECT)
->where('program')->eq(0)
@@ -20,7 +21,7 @@ class programModel extends model
->beginIF(!$includeCat)->andWhere('iscat')->eq(0)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->beginIF($status != 'all')->andWhere('status')->eq($status)->fi()
->beginIF($this->cookie->mine)
->beginIF($this->cookie->mine or $mine)
->andWhere('openedBy', true)->eq($this->app->user->account)
->orWhere('PM')->eq($this->app->user->account)
->markRight(1)