Files
OMS/app/erpapi/lib/dealer/config.php
2025-12-28 23:13:25 +08:00

59 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
/**
* 一件代发CONFIG
*
* @author wangbiao@shopex.cn
* @version 2024.04.11
*/
class erpapi_dealer_config extends erpapi_config
{
/**
* 初始化
* @param erpapi_channel_abstract $channel channel
* @return mixed 返回值
*/
public function init(erpapi_channel_abstract $channel)
{
if($channel->channel['delivery_mode'] == 'jingxiao') {
$this->__whitelist = [SHOP_TRADE_FULLINFO_RPC];
} else {
//共用erpapi_shop路由中的白名单
$this->__whitelist = kernel::single('erpapi_shop_whitelist')->getWhiteList($channel->channel['node_type']);
}
return parent::init($channel);
}
/**
* 应用级参数
*
* @param String $method 请求方法
* @param Array $params 业务级请求参数
* @return array
**/
public function get_query_params($method, $params)
{
$query_params = array(
'app_id' => 'ecos.ome',
'method' => $method,
'date' => date('Y-m-d H:i:s'),
'format' => 'json',
'certi_id' => base_certificate::certi_id(),
'v' => $this->__channelObj->channel['matrix_api_v'] ? $this->__channelObj->channel['matrix_api_v'] : '1',
'from_node_id' => base_shopnode::node_id('ome'),
'to_node_id' => $this->__channelObj->channel['node_id'],
'to_api_v' => $this->__channelObj->channel['api_version'],
'node_type' => $this->__channelObj->channel['node_type'],
);
$app_xml = app::get('ome')->define();
$query_params['from_api_v'] = $app_xml['api_ver'];
return $query_params;
}
}