getActiveByDate($todayTime, '='); } /** * 获取当天的活动 * @return array|false|\PDOStatement|string|\think\Model * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function getNextActive() { $todayTime = strtotime(date('Y-m-d')); return $this->getActiveByDate($todayTime, '>'); } /** * 根据日期获取活动 * @param $date * @param string $op * @return array|false|\PDOStatement|string|\think\Model * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ private function getActiveByDate($date, $op = '=') { return $this->where('active_date', $op, $date) ->where('status', '=', 1) ->where('is_delete', '=', 0) ->find(); } }