moonsflyer 4 months ago
parent
commit
f9f6126ee9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      phalapi/src/app/Model/Home.php

+ 4 - 1
phalapi/src/app/Model/Home.php

@@ -154,14 +154,17 @@ class Home extends NotORM{
     public function getClassidShopLists($type,$province,$name,$p){
     public function getClassidShopLists($type,$province,$name,$p){
 
 
         $where['type'] = $type;
         $where['type'] = $type;
+        $where2 = "type={$type} ";
         if(!empty($province)){
         if(!empty($province)){
             $where['province'] = $province;
             $where['province'] = $province;
+            $where2 .="and province='{$province}' ";
         }
         }
         if(!empty($name)){
         if(!empty($name)){
 //            $where['province'] = $province;
 //            $where['province'] = $province;
 //            $where .= " and name like '%{$name}%' " ;  user_nickname like '%{$key}%'
 //            $where .= " and name like '%{$name}%' " ;  user_nickname like '%{$key}%'
+            $where2 .=" and name like '%{$name}%' ";
         }
         }
-        $where2 = "type={$type} and province='{$province}' ";
+
         $info=\App\getClassidShopLists($where2,$name,$p);
         $info=\App\getClassidShopLists($where2,$name,$p);
         return $info;
         return $info;
     }
     }