thinkphp3.2框架中,where条件中多字段满足一个字段的条件就把记录筛选出来。
ThinkPHP3.2where中的or查询
thinkphp3.2框架中,where条件中多字段满足一个字段的条件就把记录筛选出来。
$where['status'] = ['eq', 1];
$where['delete_time'] = ['eq', 0];
$map['normal_integrals'] = ['gt', 0];
$map['vip_integrals'] = ['gt', 0];
$map['_logic'] = 'or';
$where['_complex'] = $map;
$list = M('coupon')
->field('*')
->where($where)
->order('id desc')
->page($page)
->limit($pageSize)
->select();
$count = M('coupon')
->where($where)
->count();
转载注明:
感谢博主,喝杯咖啡~
感谢博主,喝杯咖啡~
还没有人发表评论