diff --git a/app/Service/Api/Good/AddStapleFoodInfoService.php b/app/Service/Api/Good/AddStapleFoodInfoService.php index 061020b..65888c5 100644 --- a/app/Service/Api/Good/AddStapleFoodInfoService.php +++ b/app/Service/Api/Good/AddStapleFoodInfoService.php @@ -55,7 +55,8 @@ class AddStapleFoodInfoService extends BaseService $data = $this->goodCache->getMealGoodList(); $res = []; - foreach ($data as $item) { + if (empty($data['sku_list'])) return $this->return->success('success', ['add_food_info' => $res]); + foreach ($data['sku_list'] as $item) { if ($item['is_add_staple_food'] != GoodCode::IS_ADD_STAPLE_FOOD) continue; $res[] = $item;