mirror of
https://gitee.com/ShopeX/OMS
synced 2026-04-06 14:55:37 +08:00
175 lines
6.2 KiB
PHP
175 lines
6.2 KiB
PHP
<?php
|
||
/**
|
||
* Copyright © ShopeX (http://www.shopex.cn). All rights reserved.
|
||
* See LICENSE file for license details.
|
||
*/
|
||
|
||
class logisticsmanager_waybill_wxshipin
|
||
{
|
||
|
||
/**
|
||
* service_code
|
||
* @param mixed $param param
|
||
* @return mixed 返回值
|
||
*/
|
||
public function service_code($param)
|
||
{
|
||
$cpCode = $param['logistics'];
|
||
$service = [
|
||
/*
|
||
'ZTO' => array(
|
||
'site_code' => array(
|
||
'text' => '网点编码',
|
||
'code' => 'site_code',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'acct_id' => array(
|
||
'text' => '电子面单账号id',
|
||
'code' => 'acct_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'shop_id' => array(
|
||
'text' => '店铺id',
|
||
'code' => 'shop_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
),
|
||
'YTO' => array(
|
||
'site_code' => array(
|
||
'text' => '网点编码',
|
||
'code' => 'site_code',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'acct_id' => array(
|
||
'text' => '电子面单账号id',
|
||
'code' => 'acct_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'shop_id' => array(
|
||
'text' => '店铺id',
|
||
'code' => 'shop_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
),
|
||
'YUNDA' => array(
|
||
'site_code' => array(
|
||
'text' => '网点编码',
|
||
'code' => 'site_code',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'acct_id' => array(
|
||
'text' => '电子面单账号id',
|
||
'code' => 'acct_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'shop_id' => array(
|
||
'text' => '店铺id',
|
||
'code' => 'shop_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
),
|
||
'JTSD' => array(
|
||
'site_code' => array(
|
||
'text' => '网点编码',
|
||
'code' => 'site_code',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'acct_id' => array(
|
||
'text' => '电子面单账号id',
|
||
'code' => 'acct_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'shop_id' => array(
|
||
'text' => '店铺id',
|
||
'code' => 'shop_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
),
|
||
'STO' => array(
|
||
'site_code' => array(
|
||
'text' => '网点编码',
|
||
'code' => 'site_code',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'acct_id' => array(
|
||
'text' => '电子面单账号id',
|
||
'code' => 'acct_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
'shop_id' => array(
|
||
'text' => '店铺id',
|
||
'code' => 'shop_id',
|
||
'input_type' => 'input',
|
||
// 'require' => 'true',
|
||
),
|
||
),
|
||
*/
|
||
];
|
||
return isset($service[$cpCode]) ? $service[$cpCode] : [];
|
||
|
||
}
|
||
|
||
/**
|
||
* 打印组件三个接口
|
||
* 获取打印数据 /logistics/waybillApply
|
||
* 获取标准模板 /logistics/templateList
|
||
* 获取自定义模板 /logistics/customTemplateList
|
||
* @return array [description]
|
||
*/
|
||
public function template_cfg()
|
||
{
|
||
$arr = array(
|
||
'template_name' => '微信视频号',
|
||
'shop_name' => '微信视频号',
|
||
'print_url' => 'https://support.weixin.qq.com/cgi-bin/mmsupportacctnodeweb-bin/pages/e4TWKgMu17AalV2l',
|
||
// windows:https://res.wx.qq.com/shop/print/ChannelsShopPrintClient-setup.exe
|
||
// mac:https://mmec-shop-1258344707.cos.ap-shanghai.myqcloud.com/shop/print/ChannelsShopPrintClient.dmg
|
||
// 'template_url' => '',
|
||
'shop_type' => 'wxshipin',
|
||
'control_type' => 'wxshipin',
|
||
'request_again' => false,
|
||
);
|
||
return $arr;
|
||
}
|
||
|
||
/**
|
||
* 获取物流公司编码
|
||
* @param Sring $logistics_code 物流代码
|
||
* @return array
|
||
*/
|
||
public function logistics($logistics_code = '')
|
||
{
|
||
$logistics = [
|
||
'ZTO' => ['code' => 'ZTO', 'name' => '中通'],
|
||
'YTO' => ['code' => 'YTO', 'name' => '圆通'],
|
||
'YUNDA' => ['code' => 'YUNDA', 'name' => '韵达'],
|
||
'JTSD' => ['code' => 'JTSD', 'name' => '极兔'],
|
||
'STO' => ['code' => 'STO', 'name' => '申通'],
|
||
'SF' => ['code' => 'SF', 'name' => '顺丰'],
|
||
'JD' => ['code' => 'JD', 'name' => '京东'],
|
||
'EMS' => ['code' => 'EMS', 'name' => '中国邮政'],
|
||
'CNSD' => ['code' => 'CNSD', 'name' => '菜鸟速递(丹鸟)'],
|
||
'DBKD' => ['code' => 'DBKD', 'name' => '德邦快递'],
|
||
];
|
||
|
||
if (!empty($logistics_code)) {
|
||
return $logistics[$logistics_code];
|
||
}
|
||
return $logistics;
|
||
}
|
||
}
|