diff --git a/app/common/service/PostService.php b/app/common/service/PostService.php index eac29a6..cc38256 100644 --- a/app/common/service/PostService.php +++ b/app/common/service/PostService.php @@ -119,7 +119,7 @@ class PostService $category = PostCategory::where('id',$data['category_id'])->first(); $models = explode(',',$data['model']); - foreach ($data['model'] as $key => $model) { + foreach ($models as $key => $model) { $code = (new SkuService)->generateUniqueCode(); Sku::firstOrCreate(['model' => $model], ['category_id' => $data['category_id'], 'product_name' => $category['name'],'code' => $code]);