TP多条件查询实例
程序员文章站
2022-03-25 17:44:49
where条件查询,时间范围查询 $condition = [ ['member_id', '=', $member_id] ]; if($type) { $condition[] = ['type', '=', $type]; } if ($start_time) { $condition[] = ......
where条件查询,时间范围查询
$condition = [ ['member_id', '=', $member_id] ]; if($type) { $condition[] = ['type', '=', $type]; } if ($start_time) { $condition[] = ['active_time', '>=', $start_time]; } if ($end_time) { $condition[] = ['active_time', '<', $end_time]; } $list = $this->where($condition)->field($field)->select();
上一篇: 在vue2.0中如何实现通讯?
下一篇: php针对字符串的遍历与查找