*Optimize the code.

This commit is contained in:
孙华伟
2022-03-28 17:17:13 +08:00
parent d8d1e2e3ee
commit 5aea0c9ac7
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -1291,7 +1291,7 @@ class product extends control
$this->view->position[] = $this->lang->product->line;
$this->view->programs = array('') + $this->loadModel('program')->getTopPairs();
$this->view->lines = $this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->orderBy('`order`')->fetchAll();
$this->view->lines = $this->product->getLines();
$this->display();
}
+11 -1
View File
@@ -1786,7 +1786,7 @@ class productModel extends model
*
* @param int $programID
* @access public
* @return void
* @return array
*/
public function getLinePairs($programID = 0)
{
@@ -1797,6 +1797,16 @@ class productModel extends model
->fetchPairs();
}
/*
* Get all lines.
* @access public
* @return array
*/
public function getLines()
{
return $this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->orderBy('`order`')->fetchAll();
}
/**
* Get the summary of product's stories.
*