* Code for details.

This commit is contained in:
Yagami
2021-02-23 09:30:21 +08:00
parent 535fb750b3
commit 424c6ae400
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -332,7 +332,7 @@ class product extends control
$this->view->qdUsers = $qdUsers;
$this->view->rdUsers = $rdUsers;
$this->view->users = $this->user->getPairs('nodeleted|noclosed');
$this->view->programs = array('') + $this->loadModel('program')->getTopPGMPairs();
$this->view->programs = array('') + $this->loadModel('program')->getTopPGMPairs('', 'noclosed');
$this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs();
unset($this->lang->product->typeList['']);
@@ -440,6 +440,7 @@ class product extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
$productID = $this->product->saveState($productID, $this->products);
$this->product->setMenu($this->products, $productID);
$moduleIndex = array_search('product', $this->lang->noMenuModule);
+3 -2
View File
@@ -442,15 +442,16 @@ class programModel extends model
* Get top program pairs.
*
* @param string $model
* @param string $mode
* @access public
* @return array
*/
public function getTopPGMPairs($model = '')
public function getTopPGMPairs($model = '', $mode = '')
{
return $this->dao->select('id,name')->from(TABLE_PROGRAM)
->where('type')->eq('program')
->andWhere('grade')->eq(1)
->andWhere('status')->ne('closed')
->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->andWhere('id')->in($this->app->user->view->programs)
->andWhere('deleted')->eq(0)
->beginIF($model)->andWhere('model')->eq($model)->fi()