Forráskód Böngészése

Fix when empty products table

Alexander Musikhin 10 hónapja
szülő
commit
37332caf39
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      app/Http/Controllers/ProductController.php

+ 2 - 2
app/Http/Controllers/ProductController.php

@@ -79,8 +79,8 @@ class ProductController extends Controller
         $dates = [
             'created_at' => [
                 'title' => 'Дата создания',
-                'min'   => DateHelper::getDateForDB(Product::query()->min('created_at')),
-                'max'   => DateHelper::getDateForDB(Product::query()->max('created_at')),
+                'min'   => DateHelper::getDateForDB(Product::query()->min('created_at') ?? ''),
+                'max'   => DateHelper::getDateForDB(Product::query()->max('created_at') ?? ''),
             ]
         ];