Commit f05fb3d6 by mushishixian

fix

parent b6d2fd2e
......@@ -45,6 +45,7 @@ type ActivityItem struct {
ItemName string `json:"item_name"`
Pic string `json:"pic"`
Remark string `json:"remark"`
Content string `json:"content"`
AddTime int `json:"add_time"`
}
......
......@@ -70,6 +70,9 @@ type LySku struct {
type PriceActivity struct {
ActivityCommon
Ratio float64 `json:"ratio"`
SignText string `json:"sign_text"`
Sign string `json:"sign"`
ShowName string `json:"show_name"`
}
type GiftActivity struct {
......@@ -82,9 +85,6 @@ type ActivityCommon struct {
ActivityId int `json:"activity_id,omitempty"`
ActivityName string `json:"activity_name,omitempty"`
AllowCoupon int `json:"-"`
SignText string `json:"sign_text"`
Sign string `json:"sign"`
ShowName string `json:"show_name"`
}
//为什么不直接映射到结构,而要用gjson,因为redis存的数据结构不一定正常,可能类型不一致
......
......@@ -90,6 +90,10 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
}
INFO:
if hasActivity {
for key, item := range activity.ItemList {
activity.ItemList[key].Content = "订单满" + gconv.String(item.Amount) + "元赠" +
gconv.String(item.ItemName) + "X" + gconv.String(item.Num)
}
giftActivity.ActivityName = activity.ActivityName
giftActivity.ActivityId = activity.ActivityId
giftActivity = model.GiftActivity{
......@@ -99,9 +103,6 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
ActivityId: activity.ActivityId,
ActivityName: activity.ActivityName,
AllowCoupon: activity.AllowCoupon,
SignText: activity.SignText,
Sign: activity.Sign,
ShowName: activity.ShowName,
},
}
}
......@@ -172,15 +173,15 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
priceActivity.ActivityName = activity.ActivityName
priceActivity.ActivityId = activity.ActivityId
priceActivity = model.PriceActivity{
Ratio: activity.Ratio,
Ratio: activity.Ratio,
SignText: activity.SignText,
Sign: activity.Sign,
ShowName: activity.ShowName,
ActivityCommon: model.ActivityCommon{
HasActivity: hasActivity,
ActivityId: activity.ActivityId,
ActivityName: activity.ActivityName,
AllowCoupon: activity.AllowCoupon,
SignText: activity.SignText,
Sign: activity.Sign,
ShowName: activity.ShowName,
},
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment