xieruidong 2 years ago
parent
commit
ae3fef02d4
2 changed files with 26 additions and 2 deletions
  1. 2 2
      extend/logistics/Kd100.php
  2. 24 0
      extend/logistics/QueryInterface.php

+ 2 - 2
extend/logistics/Kd100.php

@@ -21,9 +21,9 @@ class Kd100 extends QueryInterface{
 
         //参数设置
         $key = $this->key;                        // 客户授权key
-        $customer = '';                   // 查询公司编号
+        $customer = $this->customer;                   // 查询公司编号
         $param = array (
-            'com' => 'yunda',             // 快递公司编码
+            'com' => $this->get,             // 快递公司编码
             'num' => '3950055201640',     // 快递单号
             'phone' => '',                // 手机号
             'from' => '',                 // 出发地城市

+ 24 - 0
extend/logistics/QueryInterface.php

@@ -1,10 +1,15 @@
 <?php
 namespace logistics;
 
+use app\common\model\LogisticsCompany;
+use fast\Arr;
+
 abstract class QueryInterface{
     protected $no;
     protected $username;
     protected $phone;
+    /** @var LogisticsCompany */
+    protected $logistics;
     abstract public function query();
     public function setNo($value){
         $this->no=$value;
@@ -44,4 +49,23 @@ abstract class QueryInterface{
         return $this->phone;
     }
 
+    /**
+     * @param LogisticsCompany $logistics
+     */
+    public function setLogistics(LogisticsCompany $logistics)
+    {
+        $this->logistics = $logistics;
+        return $this;
+    }
+
+    /**
+     * @return LogisticsCompany
+     */
+    public function getLogistics($field=null)
+    {
+        if(is_null($field)) {
+            return $this->logistics;
+        }
+        return Arr::get($this->logistics,$field);
+    }
 }