...
|
...
|
@@ -22,36 +22,46 @@ |
|
|
namespace app\kdnapi\controller;
|
|
|
|
|
|
|
|
|
use think\Controller;
|
|
|
use think\Db;
|
|
|
|
|
|
class KdnApiController
|
|
|
class KdnApiController extends Controller
|
|
|
{
|
|
|
|
|
|
public function aa(){
|
|
|
return $this->orderTracesSubByJson('77');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Json方式 物流信息订阅
|
|
|
*/
|
|
|
public function orderTracesSubByJson(){
|
|
|
$requestData="{'OrderCode': 'SF201608081055208281',".
|
|
|
"'ShipperCode':'SF',".
|
|
|
"'LogisticCode':'3100707578976',".
|
|
|
"'PayType':1,".
|
|
|
"'ExpType':1,".
|
|
|
"'IsNotice':0,".
|
|
|
"'Cost':1.0,".
|
|
|
"'OtherCost':1.0,".
|
|
|
public function orderTracesSubByJson($id){
|
|
|
$arr1=Db::name('zj_order')->alias('o')->join('zj_kd k','o.kid=k.id','left')->where('o.id',$id)
|
|
|
->field('o.*,k.code')->find();
|
|
|
$arr2=Db::name('zj_system')->find();
|
|
|
|
|
|
|
|
|
$requestData="{'OrderCode': '',".
|
|
|
"'ShipperCode':'". $arr1['code'] ."',".
|
|
|
"'LogisticCode':".$arr1['kd_num'].",".
|
|
|
"'PayType':'',".
|
|
|
"'ExpType':'',".
|
|
|
"'IsNotice':'',".
|
|
|
"'Cost':'',".
|
|
|
"'OtherCost':'',".
|
|
|
"'Sender':".
|
|
|
"{".
|
|
|
"'Company':'LV','Name':'Taylor','Mobile':'15018442396','ProvinceName':'上海','CityName':'上海','ExpAreaName':'青浦区','Address':'明珠路73号'},".
|
|
|
"'Name':'". $arr2['name'] ."','Mobile':'". $arr2['fmobile'] ."','ProvinceName':'". $arr2['province'] ."','CityName':'". $arr2['city'] ."','ExpAreaName':'". $arr2['county'] ."','Address':'". $arr2['place'] ."'},".
|
|
|
"'Receiver':".
|
|
|
"{".
|
|
|
"'Company':'GCCUI','Name':'Yann','Mobile':'15018442396','ProvinceName':'北京','CityName':'北京','ExpAreaName':'朝阳区','Address':'三里屯街道雅秀大厦'},".
|
|
|
"'Name':'". $arr1['name'] ."','Mobile':'". $arr1['mobile'] ."','ProvinceName':'". $arr1['province'] ."','CityName':'". $arr1['city'] ."','ExpAreaName':'". $arr1['county'] ."','Address':'". $arr1['place'] ."'},".
|
|
|
"'Commodity':".
|
|
|
"[{".
|
|
|
"'GoodsName':'鞋子','Goodsquantity':1,'GoodsWeight':1.0}],".
|
|
|
"'Weight':1.0,".
|
|
|
"'Quantity':1,".
|
|
|
"'Volume':0.0,".
|
|
|
"'Remark':'小心轻放'}";
|
|
|
|
|
|
"'GoodsName':'','Goodsquantity':'','GoodsWeight':''}],".
|
|
|
"'Weight':'',".
|
|
|
"'Quantity':'',".
|
|
|
"'Volume':'',".
|
|
|
"'Remark':''}";
|
|
|
|
|
|
$datas = array(
|
|
|
'EBusinessID' => config('EBusinessID'),
|
...
|
...
|
@@ -116,16 +126,4 @@ class KdnApiController |
|
|
private function encrypt($data, $appkey) {
|
|
|
return urlencode(base64_encode(md5($data.$appkey)));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 推送接口
|
|
|
*/
|
|
|
public function kdApi(){
|
|
|
$request = request();
|
|
|
$param='2';
|
|
|
if ($request->param()){
|
|
|
$param=input('param.');
|
|
|
}
|
|
|
Db::name('zj_kd_order')->insert(['text'=>$param]);
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|