xg 2 years ago
parent
commit
e2dbb1b5d8

+ 1 - 0
application/api/controller/MobileController.php

@@ -94,6 +94,7 @@ class MobileController extends UserApi
         if(empty($data['type'])){
             $data['type']=1;
         }
+        $map=[];
         $model=Mobile::show($data);
         $model->where('type',$data['type']);
         if(!empty($data['search_type']) && !empty($data['keyword'])){

+ 6 - 0
application/common/library/Query.php

@@ -0,0 +1,6 @@
+<?php
+namespace app\common\library;
+
+class Query extends \think\db\Query{
+
+}

+ 1 - 1
application/common/model/Mobile.php

@@ -254,7 +254,7 @@ class Mobile extends Model
                 $model->where('status',0);
             }
         }
-        return $model;
+        return $model->getQuery();
     }
 
     /**

+ 6 - 1
thinkphp/library/think/db/Query.php

@@ -34,7 +34,7 @@ use think\Paginator;
  * Class Query
  * @package think\db
  */
-class Query
+class QueryRoot
 {
     // 数据库Connection对象实例
     protected $connection;
@@ -3053,3 +3053,8 @@ class Query
         $this->setBuilder();
     }
 }
+class Query extends QueryRoot{
+    public function __clone(){
+        $this->setBuilder();
+    }
+}