1, multi-condition fuzzy inquiry
equals: m A P [ ' I D ' ] = A R & lt R & lt A Y ( ' E Q ' , 100 ) ; not like to : Map [ 'ID'] = Array ( 'EQ', 100 ); is not equal to: map [ 'id'] = array ( 'neq', 100);
greater than: m A P [ ' I D ' ] = A R & lt R & lt A Y ( ' G T ' , 100 ); Large in other to : Map [ 'ID'] = Array ( 'gt', 100); than or equal to: map [ 'id'] =
less than:mAP['ID']=AR & ltR & ltAY('LT' , 100 ) ; less in other to : Map [' ID '] = Array (' lt ', 100); or less: map [' id '] ='elt', 100);
Fuzzy query:mAP['n-AmE']=Array(‘like′,′thinkphpbetween:map[‘name′]=array(‘like′,′thinkphpbetween:map[‘id’]=array(‘between’,’1,8’);
map[‘id′]=array(‘between′,array(‘1′,‘8′));in:map[‘id′]=array(‘between′,array(‘1′,‘8′));in:map[‘id’]=array(‘id’,’1,2,,3’);
map[‘id′]=array(‘notin′,′1,2,3′);map[‘id′]=array(‘notin′,′1,2,3′);data=db('user')->where($map)->select();
More than two or query conditions
such as select * from tbl where a like ' % 123%' or b like '% 123%' or c like '% 123%';
to achieve this function, thinkphp how to write it?
where[‘a’]=array(‘like’,”%123%”);
where[‘b’]=array(‘like’,”%123%”);
where[‘c’]=array(‘like’,”%123%”);
答案 :where[‘a|b|c’]=array(‘like’,”%123%”);
More than three parameters reserved paging query condition
Db :: name ( "Table") -> WHERE ( "XXXX") -> the paginate (10, to false, [ 'Query' => Request () -> param ()]);
the paginate the third method parameters