col_prefix.'bind'] == '1'){ return '组合'; }elseif ($row[$this->col_prefix.'bind'] == '2'){ return '多选一'; }else{ return '普通'; } } public $column_shop_name ='店铺名'; public $column_shop_name_order = 20; public $column_shop_name_width = "150"; /** * column_shop_name * @param mixed $row row * @param mixed $list list * @return mixed 返回值 */ public function column_shop_name($row, $list){ $shop = $this->__getShop($row, $list); return $shop['name']; } public $column_shop_type ='店铺类型'; public $column_shop_type_order = 30; public $column_shop_type_width = "100"; /** * column_shop_type * @param mixed $row row * @param mixed $list list * @return mixed 返回值 */ public function column_shop_type($row, $list){ $shop = $this->__getShop($row, $list); return ome_shop_type::shop_name($shop['shop_type']); } private function __getShop($row, $list) { static $shop = array(); if(empty($shop)) { $shopId = array(); foreach($list as $val) { $shopId[$val[$this->col_prefix . 'shop_id']] = $val[$this->col_prefix . 'shop_id']; } $shopData = app::get('ome')->model('shop')->getList('*', array('shop_id' => $shopId)); foreach($shopData as $value) { $shop[$value['shop_id']] = $value; } } return $shop[$row[$this->col_prefix . 'shop_id']] ? $shop[$row[$this->col_prefix . 'shop_id']] : array(); } }