From 84d49f15b8c901a039dc3424fc78d811797d4fbd Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Thu, 17 Apr 2025 16:02:43 +0800 Subject: [PATCH] feat : sts --- app/Constants/Common/GoodCode.php | 3 ++- app/Service/Api/Good/OptionalListService.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Constants/Common/GoodCode.php b/app/Constants/Common/GoodCode.php index 7f94478..2b1f0a7 100644 --- a/app/Constants/Common/GoodCode.php +++ b/app/Constants/Common/GoodCode.php @@ -17,11 +17,12 @@ class GoodCode const int SKU_IS_DELETE = 2; /** - * @var int 1=自选 2=套餐 3=特惠(列表) + * @var int 1=自选 2=套餐 3=特惠(列表) 5=选购 */ CONST INT SPU_TYPE_OPTIONAL = 1; CONST INT SPU_TYPE_MEAL = 2; CONST INT SPU_TYPE_FAVORABLE = 3; + CONST INT SPU_TYPE_PURCHASE = 5; /** * @var int 1=上架 2=下架 diff --git a/app/Service/Api/Good/OptionalListService.php b/app/Service/Api/Good/OptionalListService.php index 1df4848..51da944 100644 --- a/app/Service/Api/Good/OptionalListService.php +++ b/app/Service/Api/Good/OptionalListService.php @@ -115,6 +115,7 @@ class OptionalListService extends BaseService $res[$item['category_id']] = [ 'category_name' => $categoryList[$item['category_id']]['name'] ?? '', 'category_image' => $categoryImages[$item['category_id']]['url'] ?? '', + 'category_type' => GoodCode::SPU_TYPE_OPTIONAL, 'spu_list' => [] ]; } @@ -126,7 +127,8 @@ class OptionalListService extends BaseService array_unshift($res,[ 'category_name' => $this->configCache->getConfigValueByKey(ConfigCode::ONE_CLICK_SHOPPING_FOR_CATEGORY_NAME), 'category_image' => $this->getOssObjectById((int)$this->configCache->getConfigValueByKey(ConfigCode::ONE_CLICK_SHOPPING_FOR_CATEGORY_IMAGE)), - 'spu_list' => [$purchaseData] + 'category_type' => GoodCode::SPU_TYPE_PURCHASE, + 'spu_list' => $purchaseData ]); } @@ -134,7 +136,8 @@ class OptionalListService extends BaseService array_unshift($res,[ 'category_name' => $this->configCache->getConfigValueByKey(ConfigCode::SPECIALS_CATEGORY_NAME), 'category_image' => $this->configCache->getConfigValueByKey(ConfigCode::SPECIALS_CATEGORY_IMAGE), - 'spu_list' => [$favorable] + 'category_type' => GoodCode::SPU_TYPE_FAVORABLE, + 'spu_list' => $favorable ]); }