소스 검색

Fix when empty products table

Alexander Musikhin 10 달 전
부모
커밋
37332caf39
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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') ?? ''),
             ]
         ];