feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace addons\shopro_aliyun_express\controller;
|
||||
|
||||
use addons\shopro\controller\Base;
|
||||
use addons\shopro_aliyun_express\library\Bridge;
|
||||
use addons\shopro_aliyun_express\library\ExpressConfig;
|
||||
|
||||
class Express extends Base
|
||||
{
|
||||
protected $noNeedLogin = [];
|
||||
protected $noNeedRight = ['*'];
|
||||
|
||||
/**
|
||||
* 独立快递查询 API(小程序/调试)
|
||||
* GET waybill_number, phone, express_code(可选)
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
if (!ExpressConfig::getInstance()->isEnabled()) {
|
||||
$this->error('快递查询插件未启用');
|
||||
}
|
||||
|
||||
$waybillNo = trim($this->request->get('waybill_number', ''));
|
||||
$phone = trim($this->request->get('phone', ''));
|
||||
$expressCode = trim($this->request->get('express_code', ''));
|
||||
|
||||
if ($waybillNo === '') {
|
||||
$this->error('请提供快递单号');
|
||||
}
|
||||
|
||||
try {
|
||||
$result = Bridge::queryTrack($waybillNo, $phone, $expressCode, false);
|
||||
$this->success('查询成功', $result);
|
||||
} catch (\Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户