GG.deals clone: CodeIgniter 4 + MongoDB game price tracker
- 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
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Libraries\Mongo;
|
||||
|
||||
class StoreModel
|
||||
{
|
||||
private ?array $all = null;
|
||||
|
||||
/** @return array<int, array> */
|
||||
public function all(): array
|
||||
{
|
||||
if ($this->all === null) {
|
||||
$this->all = Mongo::collection('stores')->find([], ['sort' => ['kind' => 1, 'name' => 1]])->toArray();
|
||||
}
|
||||
|
||||
return $this->all;
|
||||
}
|
||||
|
||||
/** @return array<string, array> code => store */
|
||||
public function map(): array
|
||||
{
|
||||
$map = [];
|
||||
foreach ($this->all() as $s) {
|
||||
$map[$s['code']] = $s;
|
||||
}
|
||||
|
||||
return $map;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user