$where=" and (`name` like '%".$searchValue."%' or `mac` like '%".$searchValue."%') ";
$where=" and (`name` like '%".$searchValue."%' or `mac` like '%".$searchValue."%') ";
...
@@ -24,9 +25,10 @@ class RegionModel extends RelationModel{
...
@@ -24,9 +25,10 @@ class RegionModel extends RelationModel{
//返回列表(limit分页)
//返回列表(limit分页)
if($queryType=="list"){
if($queryType=="list"){
$where.=$sort." ".$limit;
$where.=$sort." ".$limit;
$fields=" *,`name` title,case `status` when 1 then '<font color=red>禁用</font>' when 0 then '<font color=green>启用</font>' end as `status` ";
$fields=" id,`name` title,`code`,`level`,`status`,postcode,updatetime,if(`level`>1 and `level`<4,'closed','open') as `state`,case pid when 1 then 0 else pid end as `pid` ";
}
}
$sql="select ".$fields." from sh_region where 1=1 and `level`<3 ".$where.";";
$sql="select ".$fields." from sh_region where 1=1 and pid < 999999 and pid = $searchPid ".$where.";";