thinkphp一条WHERE查询的写法
发布网友
发布时间:2022-04-07 09:01
我来回答
共2个回答
热心网友
时间:2022-04-07 10:31
$where['id'] = array('neq','5');
$where['age'] = array('egt','20');
$map['id'] = array('gt','15');
$map['age'] = array('lt','18');
$where['_logic'] = 'OR';
$map['_complex'] = $where;
试试
望采纳 Thx
热心网友
时间:2022-04-07 11:49
用 $map['_complex']
例如:
$where['name'] = array('like','%thinkphp%');
$where['title'] = array('like','%thinkphp%');
$where['_logic'] = 'or';
$map['_complex'] = $where;
$map['id'] = array('gt',1);
查询条件是
( id > 1) AND ( ( name like '%thinkphp%') OR ( title like '%thinkphp%') )