where('status', 1) // 1表示有效 ->where('expireTime', '>', time()) // 未过期 ->order('expireTime', 'asc') // 按到期时间排序,最先到期的排在前面 ->find(); } }