diff --git a/app/Http/Controllers/H5/GuideController.php b/app/Http/Controllers/H5/GuideController.php index 973d04b..ca6c562 100644 --- a/app/Http/Controllers/H5/GuideController.php +++ b/app/Http/Controllers/H5/GuideController.php @@ -296,16 +296,16 @@ class GuideController extends Controller $scheme[$key]['config'] = json_decode($config, true); } } - $foods = Food::where('type', Food::TYPE_FOOD)->select('id', 'name', 'icon', 'unit', 'price', 'stock as num', 'type', 'config')->orderByDesc('id')->get()?->toArray(); - foreach ($foods as $k => $v) { - if (empty($v['config'])) { - continue; - } - $foods[$k]['config'] = json_decode($v['config'], true); - } - // 合并 $scheme 和 $foods 数组 - $result = array_merge($scheme, $foods); - return $this->success('ok', $result); + // $foods = Food::where('type', Food::TYPE_FOOD)->select('id', 'name', 'icon', 'unit', 'price', 'stock as num', 'type', 'config')->orderByDesc('id')->get()?->toArray(); + // foreach ($foods as $k => $v) { + // if (empty($v['config'])) { + // continue; + // } + // $foods[$k]['config'] = json_decode($v['config'], true); + // } + // // 合并 $scheme 和 $foods 数组 + // $result = array_merge($scheme, $foods); + return $this->success('ok', $scheme); } catch (\Exception $e) { AddErrorLog::dispatch('getOrderFood file:' . $e->getFile() . ' line:' . $e->getLine() . ' message:' . $e->getMessage())->onQueue('health'); return $this->failure('获取失败');