1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- // +----------------------------------------------------------------------
- // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
- // +----------------------------------------------------------------------
- // | Author: 萤火科技 <admin@yiovo.com>
- // +----------------------------------------------------------------------
- declare (strict_types = 1);
- namespace app\common\service;
- use app\common\enum\Setting as SettingEnum;
- use app\common\library\express\Kuaidi100;
- use app\common\model\store\Setting as SettingModel;
- /**
- * 订单服务类
- * Class Order
- * @package app\common\service
- */
- class Kuaidi extends BaseService
- {
- //订阅请求接口
- public static function subscribe($expressNo, $type=1, $company=''){
- // 获取快递100配置项
- $config = SettingModel::getItem(SettingEnum::DELIVERY);
- if (empty($config['kuaidi100']['customer']) || empty($config['kuaidi100']['key'])) {
- throwError('请先到后台-设置-配送方式 补充物流查询API配置');
- }
- // 实例化快递100类
- $Kuaidi100 = new Kuaidi100($config['kuaidi100']);
- // 请求订阅接口
- return $Kuaidi100->subscribe($expressNo, $type, $company);
- }
- }
|