improvements on the games list page, better design and grid/card/list views
This commit is contained in:
@@ -17,8 +17,11 @@ use MarcReichel\IGDBLaravel\Models\Platform as IgdbPlatform;
|
||||
|
||||
class IgdbService
|
||||
{
|
||||
public function get(int $limit)
|
||||
{
|
||||
public function get(
|
||||
int $limit,
|
||||
$startDate = null,
|
||||
$endDate = null,
|
||||
) {
|
||||
try {
|
||||
$existingIds = $this->getExistingIds();
|
||||
|
||||
@@ -38,10 +41,18 @@ class IgdbService
|
||||
// ->where('category', '=', 0)
|
||||
;
|
||||
|
||||
if ($startDate) {
|
||||
$queryBuilder->where('first_release_date', '>=', $startDate);
|
||||
}
|
||||
|
||||
if ($endDate) {
|
||||
$queryBuilder->where('first_release_date', '<=', $endDate);
|
||||
}
|
||||
|
||||
if (!empty($existingIds)) {
|
||||
// Convert array of quoted strings to array of integers
|
||||
// $existingIds = array_map(function($id) {
|
||||
// return (int)str_replace('"', '', $id);
|
||||
// return (int)str_replace('"', '', $id);
|
||||
// }, $existingIds);
|
||||
$queryBuilder->whereNotIn('id', $existingIds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user