- Full gg.deals-style UI: deal feed with filters, game pages with price history charts, rankings, vouchers, news, prepaids, subscriptions, bundles, franchises, wishlist, API docs - Real data crawlers: * gg:crawl (Steam Store API + GOG Catalog + Epic free games) * gg:catalog (252K game slugs from gg.deals sitemaps) * gg:ggdeals (per-game prices via FlareSolverr session, JSON-LD parsing) * gg:seed / gg:crawl-covers (demo seed + Steam CDN cover art) - 24/7 self-updating scheduler (scripts/scheduler_loop.php, lockfile-protected) - Tailwind v4 dark/light theme, Alpine.js, Chart.js
40 lines
1010 B
PHP
40 lines
1010 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Models\StoreModel;
|
|
use App\Libraries\Mongo;
|
|
use CodeIgniter\Controller;
|
|
|
|
class Vouchers extends Controller
|
|
{
|
|
public function index(): string
|
|
{
|
|
$vouchers = Mongo::collection('vouchers')->find([], ['sort' => ['store' => 1]])->toArray();
|
|
|
|
$data = [
|
|
'pageTitle' => 'Promo Codes & Coupons — GG.deals',
|
|
'vouchers' => $vouchers,
|
|
'stores' => (new StoreModel())->map(),
|
|
];
|
|
|
|
return view('vouchers', $data);
|
|
}
|
|
|
|
public function store(string $code): string
|
|
{
|
|
$vouchers = Mongo::collection('vouchers')->find(['store' => $code], ['sort' => ['created' => -1]])->toArray();
|
|
|
|
$data = [
|
|
'pageTitle' => ucfirst($code) . ' promo codes — GG.deals',
|
|
'vouchers' => $vouchers,
|
|
'stores' => (new StoreModel())->map(),
|
|
'storeCode' => $code,
|
|
];
|
|
|
|
return view('vouchers', $data);
|
|
}
|
|
}
|