where條件查詢,時間范圍查詢
$condition = [ ['type', 'IN', '1,2,3'], ['allocate_id', '=', 0], ['member_id', '=', 0], ['card_code', '>=', $start_code], ['card_code', '<=', $end_code], ];
$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();
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/88082.html
標籤:PHP
上一篇:TP中統計指定欄位的總數
下一篇:一個PHP的SQL注入完整程序
