_appName;
$node_type = $row[$this->col_prefix . 'node_type'];
$node_id = $row[$this->col_prefix . 'node_id'];
$shop_id = $row[$this->col_prefix . 'shop_id'];
$configStr = $row[$this->col_prefix . 'config'];
$config = unserialize($configStr);
//button
$button1 = sprintf('编辑', $this->_appName, $this->_modelName, $row[$this->_primary_id], $finder_id);
$sess_id = kernel::single('base_session')->sess_id();
$callback_url = urlencode(kernel::openapi_url('openapi.ome.shop', 'shop_callback', array('shop_id' => $shop_id, 'sess_id' => $sess_id)));
$api_url = urlencode($api_url);
//button3
if(!isset($config['adapter']) || (isset($config['adapter']) && $config['adapter'] == 'matrixonline')){
$button3 = $node_id ? ' | 已绑定' : sprintf(' | 申请绑定',$app_id,$callback_url,$api_url,$finder_id,$finder_id);
}else{
$button3 = $node_id ? sprintf(' | 取消绑定',$shop_id,'unbind',$finder_id) : sprintf(' | 申请绑定',$shop_id,$finder_id);
}
//支付宝绑定授权
$button2 = '';
if($node_type == 'luban' && $node_id){
//抖音平台退货地址库
$addressObj = app::get('ome')->model('return_address');
$countNums = $addressObj->count(array('shop_id'=>$shop_id, 'contact_id|than'=>0));
if($countNums <= 0){
$button2 .= sprintf(' | 同步退货地址库', $shop_id);
}
//抖音平台地区库
$regionObj = app::get('eccommon')->model('platform_regions');
$countNums = $regionObj->count(array('shop_type'=>'luban'));
if($countNums <= 0){
$button2 .= sprintf(' | 同步平台地区库', $shop_id);
}
}
//扩展操作功能按钮
$showMateiraLUrl = 'index.php?app=desktop&act=alertpages&goto='.urlencode('index.php?app=dealer&ctl=admin_shop&act=showProduct&shop_id='.$shop_id.'&finder_id='.$finder_id);
$extend_button = ' | 查看分销商品';
return $button1 . $button3 . $button2 . $extend_button;
}
//所属经销商
var $column_business_name = '所属经销商';
var $column_business_name_width = 130;
var $column_business_name_order = 50;
/**
* column_business_name
* @param mixed $row row
* @param mixed $list list
* @return mixed 返回值
*/
public function column_business_name($row, $list)
{
$this->_getBusiness($list);
//check
$bs_id = $row[$this->col_prefix .'bs_id'];
if(empty($bs_id)){
return '';
}
$businessInfo = (isset(self::$_businessList[$bs_id]) ? self::$_businessList[$bs_id] : array());
return $businessInfo['name'];
}
//所属贸易公司
var $column_betc_name = '所属贸易公司';
var $column_betc_name_width = 130;
var $column_betc_name_order = 52;
/**
* column_betc_name
* @param mixed $row row
* @param mixed $list list
* @return mixed 返回值
*/
public function column_betc_name($row, $list)
{
$this->_getBusiness($list);
//check
$bs_id = $row[$this->col_prefix .'bs_id'];
if(empty($bs_id)){
return '';
}
$businessInfo = (isset(self::$_businessList[$bs_id]) ? self::$_businessList[$bs_id] : array());
$betcNames = array();
if($businessInfo['betcs']){
$betcNames = array_column($businessInfo['betcs'], 'betc_name');
}
return ($betcNames ? implode(',', $betcNames) : '');
}
//供货仓
var $column_supply_branch = '供货仓';
var $column_supply_branch_width = 230;
var $column_supply_branch_order = 54;
/**
* column_supply_branch
* @param mixed $row row
* @param mixed $list list
* @return mixed 返回值
*/
public function column_supply_branch($row, $list)
{
$this->_getSupplyBranchs($list);
$shop_bn = $row['shop_bn'];
//branchs
$branchNames = array();
$branchs = (isset(self::$_supplyBranchs[$shop_bn]) ? self::$_supplyBranchs[$shop_bn] : array());
if($branchs){
$branchNames = array_column($branchs, 'name');
}
return ($branchNames ? implode(',', $branchNames) : '');
}
//授权产品线
var $column_series_name = '授权产品线';
var $column_series_name_width = 230;
var $column_series_name_order = 56;
/**
* column_series_name
* @param mixed $row row
* @param mixed $list list
* @return mixed 返回值
*/
public function column_series_name($row, $list)
{
$this->_getSeriesList($list);
$shop_id = $row[$this->col_prefix .'shop_id'];
$seriesNames = array();
$seriesList = (isset(self::$_seriesList[$shop_id]) ? self::$_seriesList[$shop_id] : array());
if($seriesList){
$seriesNames = array_column($seriesList, 'series_name');
}
return ($seriesNames ? implode(',', $seriesNames) : '');;
}
/**
* 批量获取指定经销商列表(包含贸易公司信息)
*
* @param $list
* @return boolean
*/
private function _getBusiness($list)
{
//check
if(self::$_businessList) {
return true;
}
$bsIds = array_column($list, $this->col_prefix .'bs_id');
if(empty($bsIds)){
return true;
}
self::$_businessList = kernel::single('dealer_business')->getAssignBusiness($bsIds);
return true;
}
/**
* 批量获取供货仓
*
* @param $list
* @return boolean
*/
private function _getSupplyBranchs($list)
{
//check
if(self::$_supplyBranchs) {
return true;
}
$shopBns = array_column($list, 'shop_bn');
if(empty($shopBns)){
return true;
}
self::$_supplyBranchs = kernel::single('dealer_business')->getShopBranchs($shopBns);
return true;
}
/**
* 批量获取授权产品线
*
* @param $list
* @return boolean
*/
private function _getSeriesList($list)
{
//check
if(self::$_seriesList) {
return true;
}
$shopIds = array_column($list, 'shop_id');
if(empty($shopIds)){
return true;
}
self::$_seriesList = kernel::single('dealer_business')->getAssignSeries($shopIds);
return true;
}
}