没事做点事

记录工作或者感觉可以的东西

导航

Thinkphp语句拼接

例如查询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();

posted on 2017-11-29 10:30  我本飞扬  阅读(438)  评论(0)    收藏  举报