Browse Source

完善功能

gorden 9 months ago
parent
commit
6f901842e3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      app/admin/service/goods/GoodsService.php

+ 1 - 0
app/admin/service/goods/GoodsService.php

@@ -233,6 +233,7 @@ class GoodsService
                 $category->category_super_path = $category->category_super_path . '#' . $categorySuperId . '#';
             }
             $categoryIds = SysCategory::where('category_super_path', 'like', '%' . $category->category_super_path)->pluck('category_id');
+            $categoryIds = $category ? $category->toArray() : [];
             $categoryIds = array_merge($categoryIds,[$categorySuperId]);
         } elseif (!is_array($categoryIds)) {
             $categoryIds = [$categoryIds];