where('begin_at', '<=', $now) ->where('end_at', '>=', $now) ->count() > 0; } // 指定活动是否是正在进行中的活动 public static function isCurrent(int $id): bool { $now = date('Y-m-d'); return self::where('is_current', 1) ->where('id', $id) ->where('begin_at', '<=', $now) ->where('end_at', '>=', $now) ->count() > 0; } }