正在显示
4 个修改的文件
包含
15 行增加
和
15 行删除
@@ -36,8 +36,13 @@ class BirdController extends AdminBaseController | @@ -36,8 +36,13 @@ class BirdController extends AdminBaseController | ||
36 | * @throws \think\db\exception\ModelNotFoundException | 36 | * @throws \think\db\exception\ModelNotFoundException |
37 | * @throws \think\exception\DbException | 37 | * @throws \think\exception\DbException |
38 | */ | 38 | */ |
39 | - public function createOrder($indent_id = null) | 39 | + public function createOrder() |
40 | { | 40 | { |
41 | + if(empty($_POST['indent_id'])){ | ||
42 | + $indent_id = null; | ||
43 | + }else{ | ||
44 | + $indent_id = $_POST['indent_id']; | ||
45 | + } | ||
41 | if(empty($indent_id)){ | 46 | if(empty($indent_id)){ |
42 | return "缺少必要参数"; | 47 | return "缺少必要参数"; |
43 | } | 48 | } |
@@ -236,12 +236,12 @@ $configs = [ | @@ -236,12 +236,12 @@ $configs = [ | ||
236 | //快递鸟参数配置 | 236 | //快递鸟参数配置 |
237 | 'bird'=>[ | 237 | 'bird'=>[ |
238 | //正式 | 238 | //正式 |
239 | - 'EBusinessID' => '1472267',//电商ID | ||
240 | - 'AppKey' => 'cc8314fd-0381-4e37-ad17-239287f1d8d2',//AppKey | 239 | + /* 'EBusinessID' => '1472267',//电商ID |
240 | + 'AppKey' => 'cc8314fd-0381-4e37-ad17-239287f1d8d2',//AppKey*/ | ||
241 | //测试 | 241 | //测试 |
242 | -// 'EBusinessID' => 'test1472267', | ||
243 | -// 'AppKey' => 'f84c7071-a6c7-48ce-8fe0-11b719d88a1d', | ||
244 | - ], | 242 | + 'EBusinessID' => 'test1472267', |
243 | + 'AppKey' => 'f84c7071-a6c7-48ce-8fe0-11b719d88a1d', | ||
244 | +], | ||
245 | //快递鸟预约取件接口寄件人参数 | 245 | //快递鸟预约取件接口寄件人参数 |
246 | 'sender'=>[ | 246 | 'sender'=>[ |
247 | 'Name' => "姚鹏程", | 247 | 'Name' => "姚鹏程", |
@@ -36,13 +36,8 @@ class BirdController extends HomeBaseController | @@ -36,13 +36,8 @@ class BirdController extends HomeBaseController | ||
36 | * @throws \think\db\exception\ModelNotFoundException | 36 | * @throws \think\db\exception\ModelNotFoundException |
37 | * @throws \think\exception\DbException | 37 | * @throws \think\exception\DbException |
38 | */ | 38 | */ |
39 | - public function createOrder() | 39 | + public function createOrder($indent_id = null) |
40 | { | 40 | { |
41 | - if(empty($_POST['indent_id'])){ | ||
42 | - $indent_id = null; | ||
43 | - }else{ | ||
44 | - $indent_id = $_POST['indent_id']; | ||
45 | - } | ||
46 | if(empty($indent_id)){ | 41 | if(empty($indent_id)){ |
47 | return "缺少必要参数"; | 42 | return "缺少必要参数"; |
48 | } | 43 | } |
@@ -106,14 +101,13 @@ class BirdController extends HomeBaseController | @@ -106,14 +101,13 @@ class BirdController extends HomeBaseController | ||
106 | //解析在线下单返回结果 | 101 | //解析在线下单返回结果 |
107 | $result = json_decode($jsonResult, true); | 102 | $result = json_decode($jsonResult, true); |
108 | cache('test',$result); | 103 | cache('test',$result); |
109 | - dump($result);die; | ||
110 | if ($result["ResultCode"] == "100") { | 104 | if ($result["ResultCode"] == "100") { |
111 | if(!empty($result['Order']['LogisticCode'])){ | 105 | if(!empty($result['Order']['LogisticCode'])){ |
112 | $indentModel->updateData(['id'=>$indent_id],['logistic_code'=>$result['Order']['LogisticCode']]); | 106 | $indentModel->updateData(['id'=>$indent_id],['logistic_code'=>$result['Order']['LogisticCode']]); |
113 | } | 107 | } |
114 | - return json_encode(['code'=>20000,'msg'=>'SUCCESS','data'=>$result]);//返回快递单号 | 108 | + return dump(['code'=>20000,'msg'=>'SUCCESS','data'=>$result]);//返回快递单号 |
115 | } else { | 109 | } else { |
116 | - return json_encode(['code'=>40000,'msg'=>$result['Reason']]); | 110 | + return dump(['code'=>40000,'msg'=>$result['Reason']]); |
117 | } | 111 | } |
118 | } | 112 | } |
119 | 113 |
-
请 注册 或 登录 后发表评论