* finish task #5297.

This commit is contained in:
wangyidong
2019-02-25 14:09:57 +08:00
parent 5ed0ed92fd
commit 373aedfc0b
4 changed files with 18 additions and 9 deletions
+1 -1
View File
@@ -662,7 +662,7 @@ class blockModel extends model
$products = $this->loadModel('product')->getList($status);
if(empty($products)) return $products;
$lines = $this->loadModel('tree')->getLinePairs();
$lines = $this->loadModel('tree')->getLinePairs($useShort = true);
$productList = array();
foreach($lines as $id => $name)
{
+1 -6
View File
@@ -588,14 +588,9 @@ class product extends control
$this->view->extra = $extra;
$products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($this->products))->orderBy('`order` desc')->fetchAll('id');
$productPairs = array();
foreach($products as $product) $productPairs[$product->id] = $product->name;
$productsPinyin = common::convert2Pinyin($productPairs);
foreach($products as $key => $product) $product->key = $productsPinyin[$product->name];
/* Sort products as lines' order first. */
$lines = $this->loadModel('tree')->getLinePairs();
$lines = $this->loadModel('tree')->getLinePairs($useShort = true);
$productList = array();
foreach($lines as $id => $name)
{
+8 -2
View File
@@ -173,12 +173,18 @@ class treeModel extends model
/**
* Get line pairs.
*
* @param bool $useShort
* @access public
* @return array
*/
public function getLinePairs()
public function getLinePairs($useShort = false)
{
return $this->dao->select('id, name')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->fetchPairs();
$lines = $this->dao->select('id,name,short')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->fetchAll('id');
$linePairs = array();
foreach($lines as $lineID => $line) $linePairs[$lineID] = ($useShort and !empty($line->short)) ? $line->short : $line->name;
return $linePairs;
}
/**
+8
View File
@@ -15,3 +15,11 @@
/* Finish task #5068*/
.main-table .table{cursor:pointer;}
#dropMenu.show-right-col{width:502px;max-width:520px;}
#dropMenu>.search-box{max-width:240px;}
#dropMenu .list-group{width:250px; max-width:260px;}
#dropMenu.show-right-col>.list-group{width:502px;max-width:520px;}
#dropMenu.show-right-col .col-left>.list-group{width:250px;max-width:260px;}
#dropMenu.show-right-col .col-right>.list-group{width:250px;max-width:260px;}
#dropMenu .col-footer{width:230px;}