$delve = $comname['name'];
$where= "status = 2";
$where.= " and is_del = 0";
$where.= " and developer = '$delve'";//如果是数字不用带引号,如果为汉子需带引号
//公司查询
$company_id = trim(I("company_id"),',') ; //去除最后的逗号
//地址查询
$province = trim(I("province"),',');
if($province){
$where.= " and province in ($province)"; //checkbox 多值查询用in
}
//开始面积区间
$area1 = I("area1");
if($area1){
$where.= " and area >= $area1";
}
//结束面积区间
$area2 = I("area2");
if($area2){
$where.= " and area <= $area2";
}
ThinkPHP里面的的where查询
最新推荐文章于 2024-05-06 10:07:21 发布