From 424c6ae400cc66976b96c4bdb92f55acf1eb848d Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Tue, 23 Feb 2021 09:30:09 +0800 Subject: [PATCH] * Code for details. --- module/product/control.php | 3 ++- module/program/model.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index c9a84a703a..e9d4d82462 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -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); diff --git a/module/program/model.php b/module/program/model.php index 5e971571ba..2b52955fa2 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -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()