From b1081511656b702d580052f54e05a28b607bde53 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Wed, 23 Jul 2025 15:28:06 +0800 Subject: [PATCH] feat : kitchen --- app/Service/Api/Good/OptionalListService.php | 3 ++- config/autoload/system.php | 2 ++ env.pre | 1 + env.prod | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Service/Api/Good/OptionalListService.php b/app/Service/Api/Good/OptionalListService.php index 76f0a09..8d36adc 100644 --- a/app/Service/Api/Good/OptionalListService.php +++ b/app/Service/Api/Good/OptionalListService.php @@ -25,6 +25,7 @@ use App\Service\ServiceTrait\Common\OssTrait; use Hyperf\Di\Annotation\Inject; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; +use function Hyperf\Config\config; class OptionalListService extends BaseService { @@ -68,7 +69,7 @@ class OptionalListService extends BaseService $this->goodCache->cycleId = (int)$cycleId; $siteInfo = $this->siteCache->getSiteInfo((int)$this->request->input('site_id')); - if (empty($siteInfo) || empty($siteInfo['kitchen_id'])) return $this->return->success('success', ['list' => []]); + if (empty($siteInfo) || empty($siteInfo['kitchen_id'])) $siteInfo['kitchen_id'] = config('system.kitchen_id'); $this->goodCache->kitchenId = (int)$siteInfo['kitchen_id']; $data = $this->goodCache->getOptionalGoodList(); diff --git a/config/autoload/system.php b/config/autoload/system.php index 7430d8f..98015a0 100644 --- a/config/autoload/system.php +++ b/config/autoload/system.php @@ -29,4 +29,6 @@ return [ 'api_url' => env('DEFAULT_API_URL','http://127.0.0.1:9501'), // upload_dir 'upload_dir' => BASE_PATH.'/uploads/', + // 默认的厨房 id + 'default_kitchen_id' => env('DEFAULT_KITCHEN_ID',''), ]; \ No newline at end of file diff --git a/env.pre b/env.pre index c83066e..bc876ca 100644 --- a/env.pre +++ b/env.pre @@ -6,6 +6,7 @@ JWT_KEY=hhl@shenzhen JWT_EXPIRE=2592000 ADMIN_JWT_EXPIRE=86400 DEFAULT_API_URL=https://new-api-pre.hehele.cc +DEFAULT_KITCHEN_ID=1 # [wxLogin] WX_APPID=wxc2bc0e47e212d831 diff --git a/env.prod b/env.prod index 02d63c5..cd028e4 100644 --- a/env.prod +++ b/env.prod @@ -6,6 +6,7 @@ JWT_KEY=hch@shenzhen JWT_EXPIRE=2592000 ADMIN_JWT_EXPIRE=86400 DEFAULT_API_URL=https://hch-api.hehele.cc +DEFAULT_KITCHEN_ID=1 # [wxLogin] WX_APPID=wxc0edbbd0ff0fe7ed @@ -45,7 +46,7 @@ ALI_ACCESS_KEY_ID=LTAI5tFsBsKskcrRmkjpMXay ALI_ACCESS_KEY_SECRET=YSIMtOGLu7W8tpQLKdgioTUYmgXB8M ALI_BUCKET=hhl-catering ALI_REGION=cn-shenzhen -ALI_CALLBACK_URL=https://new-api-pre.hehele.cc/common/oss/ossCallBack +ALI_CALLBACK_URL=https://hch-api.hehele.cc/common/oss/ossCallBack ALI_OSS_URL=https://hhl-catering.oss-cn-shenzhen.aliyuncs.com/ ALI_STS_ENDPOINT=sts.cn-shenzhen.aliyuncs.com ALI_ROLE_ARN=acs:ram::1644087445786901:role/oss