$where=" and (`name` like '%".$searchValue."%' or `ip_addr` like '%".$searchValue."%' or `mac` like '%".$searchValue."%') ";
$where=" and (`name` like '%".$searchValue."%' or `mac` like '%".$searchValue."%') ";
}
if($searchType){
$where.=" and `type` = ".$searchType." ";
}
}
$model=newModel();
$model=newModel();
//======================
//======================
$fields="count(pb.id) count";
$fields="count(id) count";
//返回列表(limit分页)
//返回列表(limit分页)
if($queryType=="list"){
if($queryType=="list"){
$where.=$sort." ".$limit;
$where.=$sort;
$fields="A.*,FROM_UNIXTIME(A.addtime) addtime,FROM_UNIXTIME(A.updatetime) updatetime,B.`name` sp_name,C.`name` region_name,case A.status when 0 then '<font color=red>禁用</font>' when 1 then '<font color=green>启用</font>' end as status";
$fields=" *,`name` title,case `status` when 1 then '<font color=red>禁用</font>' when 0 then '<font color=green>启用</font>' end as `status` ";
}
}
$sql="select ".$fields." from sh_hotel A join sh_sp B on A.sp_id=B.id join sh_region C on A.region_id=C.id where 1=1 ".$where.";";
$sql="select ".$fields." from sh_region where 1=1 and `level`<3 ".$where.";";