标签:sel logic sele 默认 查询 thinkphp log select 实现
tp的$map不同条件默认是 and ,如果要用or<><><><>如下
例如查询Stu表中年龄大于18,或者身高低于180cm的男性(1为男性),(例子不太好标题有可能不符,望见谅)
$where[‘age‘] = array("gt",18);
$where[‘height‘] =array("lt",180);
$where[‘_logic‘] = "OR";
$map["_complex"] = $where;
$map[‘sex‘] = 1;
$res = M("Stu")->where($map)->select();
标签:sel logic sele 默认 查询 thinkphp log select 实现
原文地址:http://www.cnblogs.com/jinshuo/p/7736005.html