xieruidong 2 роки тому
батько
коміт
e9a9e8af90

+ 4 - 4
application/common/model/Refund.php

@@ -338,10 +338,8 @@ class Refund Extends Model
             if($this->refund_type==self::REFUND_TYPE_MONEY){
                 $this->payToUser();
                 $this->orders->makeCancel();
-            }elseif($this->refund_type==self::REFUND_TYPE_ALL){
-
-            }elseif($this->refund_type==self::REFUND_TYPE_HHBX){
-
+            }elseif($this->refund_by==self::TH_TYPE_SENDER){
+                $this->makeLabelOrder();
             }
         }
         $this->save();
@@ -368,7 +366,9 @@ class Refund Extends Model
         $refund->refund_status=Refund::REFUND_OVER;
         return $refund->save();
     }
+    public function makeLabelOrder(){
 
+    }
 
     /**
      * @return string[]

+ 15 - 2
application/index/controller/Index.php

@@ -4,6 +4,7 @@ namespace app\index\controller;
 
 use app\common\controller\Frontend;
 use app\common\library\WxPublic;
+use app\common\model\LogisticsCompany;
 use app\common\model\Mobile;
 use app\common\service\MobileComputer;
 use app\service\byte_dance\ByteDance;
@@ -21,8 +22,20 @@ class Index extends Frontend
 
     public function index()
     {
-        $qr=(new WxPublic)->qr();
-        dd($qr);
+        $logis=LogisticsCompany::where('name','宅急送')->find();
+        $res=logistics()
+            ->setLogistics($logis)
+            ->setUserName('晓丽')
+            ->setPhone('13053956000')
+            ->setToArea('北京市海淀区长春桥路')
+            ->setFromUsername('晓丽')
+            ->setFromMobile('13555555555')
+            ->setFromArea('深圳市南山区金蝶软件园')
+            ->setCargo('晓丽')
+            ->setCount(1)
+            ->setOrderNo('13555555555')
+            ->labelOrder();
+        dd($res);
     }
     public function payment($a=null){
         if(!$a){

+ 14 - 13
extend/logistics/Kd100.php

@@ -12,7 +12,7 @@ class Kd100 extends QueryInterface{
     public function __construct()
     {
         $this->key=Env::get('logistics.kd100_key','fVczXhfg8960');
-        $this->secret=config('site.kd100_secret')?:'kd100';
+        $this->secret=config('site.kd100_secret')?:'5496a2da1fca49e2acc9283d1f8f32ca';
         $this->customer=Env::get('logistics.kd100_customer','B20CCD1C0BAFDD7E69CC986A1A0C57E0');
     }
 
@@ -109,14 +109,14 @@ class Kd100 extends QueryInterface{
         }
         $params=[
             'printType'=>'IMAGE',
-            'partnerId'=>config('site.kd100_lo_partnerId')?:'kd100',
-            'partnerKey'=>config('site.kd100_lo_partnerKey')?:'kd100',
-            'partnerSecret'=>config('site.kd100_lo_partnerSecret')?:'kd100',
-            'partnerName'=>config('site.kd100_lo_partnerName')?:'kd100',
-            'net'=>config('site.kd100_lo_net')?:'kd100',
-            'code'=>config('site.kd100_lo_code')?:'kd100',
-            'checkMan'=>config('site.kd100_lo_checkMan')?:'kd100',
-            'tbNet'=>config('site.kd100_lo_tbNet')?:'kd100',
+            'partnerId'=>config('site.kd100_lo_partnerId')?:null,
+            'partnerKey'=>config('site.kd100_lo_partnerKey')?:null,
+            'partnerSecret'=>config('site.kd100_lo_partnerSecret')?:null,
+            'partnerName'=>config('site.kd100_lo_partnerName')?:null,
+            'net'=>config('site.kd100_lo_net')?:null,
+            'code'=>config('site.kd100_lo_code')?:null,
+            'checkMan'=>config('site.kd100_lo_checkMan')?:null,
+            'tbNet'=>config('site.kd100_lo_tbNet')?:null,
             'kuaidicom'=>$this->logistics->code_kd100,
             'recMan'=>[
                 'name'=>$this->username,
@@ -130,16 +130,16 @@ class Kd100 extends QueryInterface{
                 'cargo'=>$this->getCargo(),
                 'count'=>$this->getCount(),
             ],
-            'tempId'=>config('site.kd100_lo_tempId')?:'kd100',
+            'tempId'=>config('site.kd100_lo_tempId')?:'3f733ac0e8ca4ebfaadfc2d9b9ca2519',
             'orderId'=>$this->getOrderNo(),
         ];
         $body=[
             'method'=>'order',
             'key'=>$this->key,
             't'=>time()*1000,
-            'param'=>$params,
+            'param'=>json_encode($params,256),
         ];
-        $body['sign']=md5(json_encode($params,256).$body['t'].$body['key'].$this->secret);
+        $body['sign']=strtoupper(md5($body['param'].$body['t'].$body['key'].$this->secret));
 
         $response=(new Client)->post('https://api.kuaidi100.com/label/order',[
             'form_params'=>$body,
@@ -152,6 +152,7 @@ class Kd100 extends QueryInterface{
         if($data['code']!=200){
             return [false,$data['message']];
         }
-        return [true,$data['label']];
+
+        return [true,$data['data']];
     }
 }