longyi 6 månader sedan
förälder
incheckning
b12bf154bd
2 ändrade filer med 49 tillägg och 42 borttagningar
  1. 13 6
      core/CoreApp/controllers/Apiexpress.php
  2. 36 36
      core/CoreApp/models/Model_logic_order.php

+ 13 - 6
core/CoreApp/controllers/Apiexpress.php

@@ -28,8 +28,18 @@ class Apiexpress extends Start_Controller {
      * @param $arg_array[1] string 请求单号
      */
     public function search($arg_array){
-        $shop = $arg_array[0];
-        $waybill_no = $arg_array[1];
+        $shop = isset($arg_array[0])?$arg_array[0]:"";
+        $waybill_no = isset($arg_array[1])?$arg_array[1]:"";
+        
+        $time = isset($arg_array[2])?$arg_array[2]:0;
+        
+        $now_time = time();
+        if(strlen( $time."") != 10){
+             die($this->logic_tools->ret_json(-1,"参数异常"));
+        }
+        // if( $now_time - $time > 3){
+        //     die($this->logic_tools->ret_json(-1,"该功能已禁用"));
+        // }
         
         if(empty($shop)){
             die($this->logic_tools->ret_json(-1,"请求店铺异常"));
@@ -42,7 +52,7 @@ class Apiexpress extends Start_Controller {
         if(empty($table_name)){
             die($this->logic_tools->ret_json(-1,"店铺未开通此功能!!!"));
         }
-        $info = $this->logic_order->getInfoByTableName($table_name,"waybill = ".$waybill_no);
+        $info = $this->logic_order->getInfoByTableName($table_name,"waybill = ".$waybill_no. " and  shop = ".$shop,"id,express,excontent,expressstate,waybill,dtime,printtime");
         if(empty($info)){
             die($this->logic_tools->ret_json(-1,"未查询到相关快递信息"));
         }
@@ -73,9 +83,6 @@ class Apiexpress extends Start_Controller {
             "received"=>$receive_time,//客户收货
             "express_trace"=>$express_trace,//快递跟踪信息
         ];
-        echo "<pre>";
-        var_dump($ret_arr);
-        die;
         die($this->logic_tools->ret_json(1,"success",$ret_arr));
 
 

+ 36 - 36
core/CoreApp/models/Model_logic_order.php

@@ -1,37 +1,37 @@
-<?php
-/**
- * 封装一些常规的订单操作
- */
-class Model_logic_order extends Lin_Model {
-    function __construct(){
-        parent::__construct();
-        $this->load->_model('Model_fullorder','fullorder');
-        $this->load->_model('Model_fullordertt','fullordertt');
-        $this->load->_model('Model_fullordersmt','fullordersmt');
-    }
-    /**
-     * 通过调用者给的表明 即其他条件查询对应的订单
-     */
-    public function getInfoByTableName($table_name,$where){
-       $info =  $this->$table_name->find($where);
-       return empty($info)?[]:$info;
-    }
-    /**
-     * 表明没有给 直接查询所有订单
-     */
-    public function getInfo($where){
-        $info =  $this->fullorder->find($where);
-        if(!empty($info)){
-            return $info;
-        }
-        $info =  $this->fullordertt->find($where);
-        if(!empty($info)){
-            return $info;
-        }
-        $info =  $this->fullordersmt->find($where);
-        if(!empty($info)){
-            return $info;
-        }
-        return [];
-    }
+<?php
+/**
+ * 封装一些常规的订单操作
+ */
+class Model_logic_order extends Lin_Model {
+    function __construct(){
+        parent::__construct();
+        $this->load->_model('Model_fullorder','fullorder');
+        $this->load->_model('Model_fullordertt','fullordertt');
+        $this->load->_model('Model_fullordersmt','fullordersmt');
+    }
+    /**
+     * 通过调用者给的表明 即其他条件查询对应的订单
+     */
+    public function getInfoByTableName($table_name,$where,$field = "*"){
+       $info =  $this->$table_name->find($where,$field);
+       return empty($info)?[]:$info;
+    }
+    /**
+     * 表明没有给 直接查询所有订单
+     */
+    public function getInfo($where){
+        $info =  $this->fullorder->find($where);
+        if(!empty($info)){
+            return $info;
+        }
+        $info =  $this->fullordertt->find($where);
+        if(!empty($info)){
+            return $info;
+        }
+        $info =  $this->fullordersmt->find($where);
+        if(!empty($info)){
+            return $info;
+        }
+        return [];
+    }
 }