作者 anyv
1 个管道 的构建 通过 耗费 1 秒

1

... ... @@ -36,8 +36,13 @@ class BirdController extends AdminBaseController
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function createOrder($indent_id = null)
public function createOrder()
{
if(empty($_POST['indent_id'])){
$indent_id = null;
}else{
$indent_id = $_POST['indent_id'];
}
if(empty($indent_id)){
return "缺少必要参数";
}
... ...
... ... @@ -236,12 +236,12 @@ $configs = [
//快递鸟参数配置
'bird'=>[
//正式
'EBusinessID' => '1472267',//电商ID
'AppKey' => 'cc8314fd-0381-4e37-ad17-239287f1d8d2',//AppKey
/* 'EBusinessID' => '1472267',//电商ID
'AppKey' => 'cc8314fd-0381-4e37-ad17-239287f1d8d2',//AppKey*/
//测试
// 'EBusinessID' => 'test1472267',
// 'AppKey' => 'f84c7071-a6c7-48ce-8fe0-11b719d88a1d',
],
'EBusinessID' => 'test1472267',
'AppKey' => 'f84c7071-a6c7-48ce-8fe0-11b719d88a1d',
],
//快递鸟预约取件接口寄件人参数
'sender'=>[
'Name' => "姚鹏程",
... ...
... ... @@ -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']]);
}
}
... ...
... ... @@ -344,6 +344,7 @@
font-weight: 400;
line-height: 0.36rem;
color: #333;
padding: 0;
}
... ...