...
|
...
|
@@ -36,13 +36,8 @@ class BirdController extends HomeBaseController |
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
* @throws \think\exception\DbException
|
|
|
*/
|
|
|
public function createOrder()
|
|
|
public function createOrder($indent_id = null)
|
|
|
{
|
|
|
if(empty($_POST['indent_id'])){
|
|
|
$indent_id = null;
|
|
|
}else{
|
|
|
$indent_id = $_POST['indent_id'];
|
|
|
}
|
|
|
if(empty($indent_id)){
|
|
|
return "缺少必要参数";
|
|
|
}
|
...
|
...
|
@@ -106,14 +101,13 @@ class BirdController extends HomeBaseController |
|
|
//解析在线下单返回结果
|
|
|
$result = json_decode($jsonResult, true);
|
|
|
cache('test',$result);
|
|
|
dump($result);die;
|
|
|
if ($result["ResultCode"] == "100") {
|
|
|
if(!empty($result['Order']['LogisticCode'])){
|
|
|
$indentModel->updateData(['id'=>$indent_id],['logistic_code'=>$result['Order']['LogisticCode']]);
|
|
|
}
|
|
|
return json_encode(['code'=>20000,'msg'=>'SUCCESS','data'=>$result]);//返回快递单号
|
|
|
return dump(['code'=>20000,'msg'=>'SUCCESS','data'=>$result]);//返回快递单号
|
|
|
} else {
|
|
|
return json_encode(['code'=>40000,'msg'=>$result['Reason']]);
|
|
|
return dump(['code'=>40000,'msg'=>$result['Reason']]);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|