赠送套餐逻辑
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m55s

This commit is contained in:
2026-04-28 17:40:06 +08:00
parent 516a7f5bdf
commit 37b4483183
34 changed files with 1172 additions and 60 deletions

View File

@@ -63,6 +63,7 @@ func (s *PackageStore) List(ctx context.Context, opts *store.QueryOptions, filte
query = query.Joins("INNER JOIN tb_shop_package_allocation ON tb_shop_package_allocation.package_id = tb_package.id AND tb_shop_package_allocation.deleted_at IS NULL").
Where("tb_shop_package_allocation.shop_id = ? AND tb_shop_package_allocation.status = ?",
shopID, constants.StatusEnabled)
query = query.Where("tb_package.is_gift = ?", false)
}
if packageName, ok := filters["package_name"].(string); ok && packageName != "" {

View File

@@ -139,13 +139,14 @@ func (s *ShopPackageAllocationStore) UpdateShelfStatus(ctx context.Context, id u
}).Error
}
func (s *ShopPackageAllocationStore) UpdateRetailPrice(ctx context.Context, id uint, retailPrice int64, updater uint) error {
func (s *ShopPackageAllocationStore) UpdateRetailPrice(ctx context.Context, id uint, retailPrice int64, priceConfigStatus int, updater uint) error {
return s.db.WithContext(ctx).
Model(&model.ShopPackageAllocation{}).
Where("id = ?", id).
Updates(map[string]interface{}{
"retail_price": retailPrice,
"updater": updater,
"retail_price": retailPrice,
"retail_price_config_status": priceConfigStatus,
"updater": updater,
}).Error
}