wangjiafang 9 vuotta sitten
vanhempi
commit
62e8adfa0b
2 muutettua tiedostoa jossa 29 lisäystä ja 6 poistoa
  1. 25 5
      mobile/control/delivery.php
  2. 4 1
      mobile/templates/default/express_info.php

+ 25 - 5
mobile/control/delivery.php

@@ -14,15 +14,35 @@ class deliveryControl extends mobileHomeControl
         parent::__construct();
     }
 
+
+    /**
+     * @desc:物流信息查询
+     * @author:jiafang.wang
+     * @since: 2016.2.22
+     */
     public function queryOp()
     {
+        //获取物流单号
+        //$order_sn = $_GET['order_sn'];
+        //$condition = ['order_sn' => $order_sn];
+        //$postid = model()->table('goods')->where($condition)->field('shipping_code')->find();
+        $postid = '227270508536';
 
-        // 查询本地是否有
-            //取参数
-            //请求快递100
-            //取得json
-            //存数据库
+        //获取物流公司
+        $com = 'shentong';
+        //key
+        $key = '5b634ac27f4c1a82';
+        //组装URL查询
+        $url = "http://api.kuaidi100.com/api?id={$key}&com={$com}&nu={$postid}&show=0&muti=1&order=desc";
+        $params = array();
+        $response = http_request($url, $params, 'GET');
+        $data = json_decode($response);
 
+        Tpl::output('info', $data);
         Tpl::showpage('express_info');
     }
+
+
+
+
 }

+ 4 - 1
mobile/templates/default/express_info.php

@@ -4,4 +4,7 @@
  * User: stanley-king
  * Date: 16/2/22
  * Time: 上午11:54
- */
+ */
+defined('InShopNC') or exit('Access Invalid!');
+
+var_dump( $out['info'] );