* @version $Id: Z */ class channel_auth_config { // 应用类型 -> 对接适配器 -> 具体平台 private $__config = array( 'kuaidi' => [ 'matrix' => array( 'label' => '商派矩阵', 'desc' => '通过WEBSERVICE和第三方快递进行对接,如(快递鸟)', 'platform' => array( 'other' => array( 'label' => '其他', 'desc' => '未指定具体快递,需在绑定时指定', 'params' => array(), ), 'kdn' => array( 'label' => '快递鸟', 'desc' => '', 'params' => array(), ), ), ) ], 'ticket' => [ 'openapi' => [ 'label' => '本地API直联', 'desc' => '可通过API接口直接对接第三方渠道', 'platform' => [ 'feisuo' => [ 'label' => '飞梭', 'desc' => '通过API接口直接对接飞梭', 'params' => [] ] ] ] ], 'cloudprint' => [ 'openapi' => [ 'label' => '本地API直联', 'desc' => '可通过API接口直接对接第三方渠道', 'platform' => [ 'yilianyun' => [ 'label' => '易联云', 'desc' => '通过API接口直接对接易联云', 'params' => [] ] ] ] ], ); /** * 获取Config * @return mixed 返回结果 */ public function getConfig() { return $this->__config; } /** * 获取AdapterList * @param mixed $chanel_type chanel_type * @return mixed 返回结果 */ public function getAdapterList($chanel_type) { $adapter = array(); if(!isset($this->__config[$chanel_type])){ return $adapter; } foreach ($this->__config[$chanel_type] as $key => $value) { $adapter[] = array('value'=>$key, 'label'=>$value['label'], 'desc'=>$value['desc']); } return $adapter; } /** * 获取PlatformList * @param mixed $channel_type channel_type * @param mixed $adapter adapter * @return mixed 返回结果 */ public function getPlatformList($channel_type,$adapter) { $platform = array(); if(!isset($this->__config[$channel_type]) || !isset($this->__config[$channel_type][$adapter])){ return $platform; } foreach ($this->__config[$channel_type][$adapter]['platform'] as $key => $value) { $platform[] = array('value'=>$key, 'label'=>$value['label']); } return $platform; } /** * 获取PlatformParam * @param mixed $channel_type channel_type * @param mixed $adapter adapter * @param mixed $platform platform * @return mixed 返回结果 */ public function getPlatformParam($channel_type, $adapter, $platform) { $params = []; if(!isset($this->__config[$channel_type]) || !isset($this->__config[$channel_type][$adapter]) || !isset($this->__config[$channel_type][$adapter][$platform])){ return $params; } return $this->__config[$channel_type][$adapter][$platform]['params']; } }