Update
This commit is contained in:
parent
17c8114b47
commit
307905849b
@ -339,6 +339,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
||||||
res = new(bundle.BundleDetailResponseV2)
|
res = new(bundle.BundleDetailResponseV2)
|
||||||
bundleProfile := &bundle.BundleProfile{}
|
bundleProfile := &bundle.BundleProfile{}
|
||||||
|
var bundleProfileLang *bundle.BundleProfileLang
|
||||||
|
|
||||||
if req.Uuid == "" {
|
if req.Uuid == "" {
|
||||||
return res, errors.New("缺少套餐UUID")
|
return res, errors.New("缺少套餐UUID")
|
||||||
@ -347,13 +348,44 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, errors.New("获取套餐信息失败")
|
return res, errors.New("获取套餐信息失败")
|
||||||
}
|
}
|
||||||
|
if req.Language != "" {
|
||||||
|
for _, lang := range detail.BundleProfileLang {
|
||||||
|
if lang.Language == req.Language {
|
||||||
|
bundleProfileLang = &bundle.BundleProfileLang{
|
||||||
|
Uuid: lang.UUID,
|
||||||
|
Name: lang.Name,
|
||||||
|
Price: lang.Price,
|
||||||
|
PriceType: lang.PriceType,
|
||||||
|
Content: lang.Content,
|
||||||
|
PayLaterTime: lang.PayLaterTime,
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//默认返回中文数据
|
||||||
|
for _, lang := range detail.BundleProfileLang {
|
||||||
|
if lang.Language == msg.ZH_CN {
|
||||||
|
bundleProfileLang = &bundle.BundleProfileLang{
|
||||||
|
Uuid: lang.UUID,
|
||||||
|
Name: lang.Name,
|
||||||
|
Price: lang.Price,
|
||||||
|
PriceType: lang.PriceType,
|
||||||
|
Content: lang.Content,
|
||||||
|
PayLaterTime: lang.PayLaterTime,
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if detail != nil {
|
if detail != nil {
|
||||||
bundleProfile = &bundle.BundleProfile{
|
bundleProfile = &bundle.BundleProfile{
|
||||||
Uuid: detail.UUID,
|
Uuid: detail.UUID,
|
||||||
Name: detail.Name,
|
Name: bundleProfileLang.Name,
|
||||||
Content: detail.Content,
|
Content: bundleProfileLang.Content,
|
||||||
Price: detail.Price,
|
Price: bundleProfileLang.Price,
|
||||||
PriceType: detail.PriceType,
|
PriceType: bundleProfileLang.PriceType,
|
||||||
ImgOption: int32(detail.ImgOption),
|
ImgOption: int32(detail.ImgOption),
|
||||||
BgImg1: detail.BgImg1,
|
BgImg1: detail.BgImg1,
|
||||||
BgImg2: detail.BgImg2,
|
BgImg2: detail.BgImg2,
|
||||||
@ -364,7 +396,7 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
|
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
|
||||||
Contract: detail.Contract,
|
Contract: detail.Contract,
|
||||||
BundleType: int64(detail.BundleType),
|
BundleType: int64(detail.BundleType),
|
||||||
PayLaterTime: int64(detail.PayLaterTime),
|
PayLaterTime: int64(bundleProfileLang.PayLaterTime),
|
||||||
}
|
}
|
||||||
if len(detail.BundleToValueAddService) > 0 {
|
if len(detail.BundleToValueAddService) > 0 {
|
||||||
var valueUuids []string
|
var valueUuids []string
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user