* finish task #5297.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;}
|
||||
|
||||
Reference in New Issue
Block a user