|
@@ -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
|
|