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

1

@@ -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
@@ -344,6 +344,7 @@ @@ -344,6 +344,7 @@
344 font-weight: 400; 344 font-weight: 400;
345 line-height: 0.36rem; 345 line-height: 0.36rem;
346 color: #333; 346 color: #333;
  347 + padding: 0;
347 } 348 }
348 349
349 350