|
@@ -102,6 +102,11 @@ class Kd100 extends QueryInterface{
|
|
|
}
|
|
|
|
|
|
public function labelOrder(){
|
|
|
+ $orderNo=$this->orderNo;
|
|
|
+ $dir=RUNTIME_PATH.'/miandan';
|
|
|
+ if(file_exists($dir."/{$orderNo}")){
|
|
|
+
|
|
|
+ }
|
|
|
$params=[
|
|
|
'printType'=>'IMAGE',
|
|
|
'partnerId'=>config('site.kd100_lo_partnerId')?:'kd100',
|
|
@@ -137,10 +142,16 @@ class Kd100 extends QueryInterface{
|
|
|
$body['sign']=md5(json_encode($params,256).$body['t'].$body['key'].$this->secret);
|
|
|
|
|
|
$response=(new Client)->post('https://api.kuaidi100.com/label/order',[
|
|
|
- 'json'=>$body,
|
|
|
+ 'form_params'=>$body,
|
|
|
'http_errors'=>false,
|
|
|
]);
|
|
|
$data=json_decode($response->getBody()->getContents(),true);
|
|
|
- dd($data);
|
|
|
+ if(!isset($data['code'])){
|
|
|
+ return [false,'请求失败'];
|
|
|
+ }
|
|
|
+ if($data['code']!=200){
|
|
|
+ return [false,$data['message']];
|
|
|
+ }
|
|
|
+ return [true,$data['label']];
|
|
|
}
|
|
|
}
|