...
|
...
|
@@ -36,7 +36,7 @@ class BirdController extends HomeBaseController |
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
* @throws \think\exception\DbException
|
|
|
*/
|
|
|
public function createOrder($indent_id = null)
|
|
|
public function createOrder($indent_id = 132)
|
|
|
{
|
|
|
if(empty($indent_id)){
|
|
|
return "缺少必要参数";
|
...
|
...
|
@@ -58,7 +58,7 @@ class BirdController extends HomeBaseController |
|
|
$region = explode(' ',$address['region']);
|
|
|
|
|
|
//请求url,接口正式地址:http://api.kdniao.com/api/OOrderService 测试环境地址:http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json
|
|
|
defined('ReqURL') or define('ReqURL', 'http://api.kdniao.com/api/OOrderService');
|
|
|
defined('ReqURL') or define('ReqURL', 'http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json');
|
|
|
|
|
|
|
|
|
//构造在线下单提交信息
|
...
|
...
|
@@ -104,9 +104,9 @@ class BirdController extends HomeBaseController |
|
|
if(!empty($result['Order']['LogisticCode'])){
|
|
|
$indentModel->updateData(['id'=>$indent_id],['logistic_code'=>$result['Order']['LogisticCode']]);
|
|
|
}
|
|
|
return ['code'=>20000,'msg'=>'SUCCESS','data'=>$result];//返回快递单号
|
|
|
return dump(['code'=>20000,'msg'=>'SUCCESS','data'=>$result]);//返回快递单号
|
|
|
} else {
|
|
|
return ['code'=>40000,'msg'=>$result['Reason']];
|
|
|
return dump(['code'=>40000,'msg'=>$result['Reason']]);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -156,7 +156,7 @@ class BirdController extends HomeBaseController |
|
|
//请求url,接口正式地址:http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx 测试环境地址:http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json
|
|
|
defined('ReqURL') or define('ReqURL', 'http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx');
|
|
|
|
|
|
$jsonResult = $this->getOrderTracesByJson($indent['order_number'],$indent['logistic_code']);
|
|
|
$jsonResult = $this->getOrderTracesByJson($indent['order_number'],$indent['logistic_code'],$indent['logistic_name']);
|
|
|
$result = json_decode($jsonResult,true);
|
|
|
if($result['Success'] == true){
|
|
|
return ['code'=>20000,'msg'=>'SUCCESS','data'=>['state'=>$result['State'],'traces'=>$result['Traces']]];//订单轨迹
|
...
|
...
|
@@ -168,8 +168,8 @@ class BirdController extends HomeBaseController |
|
|
/**
|
|
|
* Json方式 查询订单物流轨迹
|
|
|
*/
|
|
|
function getOrderTracesByJson($OrderCode,$LogisticCode){
|
|
|
$requestData= "{'OrderCode':$OrderCode,'ShipperCode':'SF','LogisticCode':$LogisticCode}";
|
|
|
function getOrderTracesByJson($OrderCode,$LogisticCode,$LogisticName){
|
|
|
$requestData= "{'OrderCode':$OrderCode,'ShipperCode':'$LogisticName','LogisticCode':$LogisticCode}";
|
|
|
|
|
|
$datas = array(
|
|
|
'EBusinessID' => EBusinessID,
|
...
|
...
|
@@ -214,7 +214,7 @@ class BirdController extends HomeBaseController |
|
|
//请求url,接口正式地址:http://api.kdniao.com/api/eorderservice 测试环境地址:http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInv
|
|
|
defined('ReqURL') or define('ReqURL', 'http://api.kdniao.com/api/dist');
|
|
|
|
|
|
$jsonResult = $this->orderTracesSubByJson($indent['order_number'],$indent['logistic_code'],$address);
|
|
|
$jsonResult = $this->orderTracesSubByJson($indent['order_number'],$indent['logistic_code'],$address,$indent['logistic_name'],$indent['logistic_name']);
|
|
|
$result = json_decode($jsonResult,true);
|
|
|
cache('b',$result);
|
|
|
if(empty($result['Reason'])){
|
...
|
...
|
@@ -227,11 +227,11 @@ class BirdController extends HomeBaseController |
|
|
/**
|
|
|
* Json方式 物流信息订阅
|
|
|
*/
|
|
|
public function orderTracesSubByJson($OrderCode,$LogisticCode,$address){
|
|
|
public function orderTracesSubByJson($OrderCode,$LogisticCode,$address,$LogisticName){
|
|
|
$sender = config('sender');
|
|
|
$region = explode(' ',$address['region']);
|
|
|
$requestData="{'OrderCode': '$OrderCode',".
|
|
|
"'ShipperCode':'SF',".
|
|
|
"'ShipperCode':'$LogisticName',".
|
|
|
"'LogisticCode':'$LogisticCode',".
|
|
|
"'PayType':1,".
|
|
|
"'ExpType':1,".
|
...
|
...
|
|