Browse Source

完善功能

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

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

@@ -233,7 +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 = $categoryIds ? $categoryIds->toArray() : [];
             $categoryIds = array_merge($categoryIds,[$categorySuperId]);
         } elseif (!is_array($categoryIds)) {
             $categoryIds = [$categoryIds];