ThinkPHP里面的的where查询

来源:互联网 发布:mac开发网站 编辑:程序博客网 时间:2024/06/15 17:27
 $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";        }