Procházet zdrojové kódy

Fix when empty products table

Alexander Musikhin před 10 měsíci
rodič
revize
37332caf39
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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') ?? ''),
             ]
         ];