|
@@ -194,24 +194,22 @@ func EventRenewalReminder(session *httpsession.Session, userid string, areaCount
|
|
if msg != "" {
|
|
if msg != "" {
|
|
return fmt.Errorf(msg), nil
|
|
return fmt.Errorf(msg), nil
|
|
}
|
|
}
|
|
- for _, info := range *productList {
|
|
|
|
- for _, sku := range info.Sku {
|
|
|
|
- if sku.Choosed {
|
|
|
|
- for _, activity := range sku.Activity {
|
|
|
|
- if activity != nil && activity.Id == sku.ActivityId {
|
|
|
|
- for _, discounts := range activity.Discount {
|
|
|
|
- if discounts != nil && discounts.Usable && discounts.LotteryId == sku.LotterId {
|
|
|
|
- if discounts.Types == 3 {
|
|
|
|
- discounts.Full = sku.OriginalPrice
|
|
|
|
- discounts.Reduce = sku.OriginalPrice - discounts.PromotionalPrice
|
|
|
|
|
|
+ if productList != nil {
|
|
|
|
+ for _, info := range *productList {
|
|
|
|
+ for _, sku := range info.Sku {
|
|
|
|
+ if sku != nil && sku.Choosed {
|
|
|
|
+ for _, activity := range sku.Activity { // 活动
|
|
|
|
+ if activity != nil && activity.Id == sku.ActivityId {
|
|
|
|
+ for _, discounts := range activity.Discount { //卡卷
|
|
|
|
+ if discounts != nil && discounts.Usable && discounts.LotteryId == sku.LotterId {
|
|
|
|
+ if discounts.Types == 3 {
|
|
|
|
+ discounts.Full = sku.OriginalPrice
|
|
|
|
+ discounts.Reduce = sku.OriginalPrice - discounts.PromotionalPrice
|
|
|
|
+ }
|
|
|
|
+ activity.Discount = []*util.Discounts{discounts}
|
|
|
|
+ sku.Activity = []*util.Activity{activity}
|
|
|
|
+ return nil, sku
|
|
}
|
|
}
|
|
- if discounts.Types == 2 && discounts.Time%12 == 0 {
|
|
|
|
- discounts.Time = discounts.Time / 12
|
|
|
|
- discounts.TimeType = 3
|
|
|
|
- }
|
|
|
|
- activity.Discount = []*util.Discounts{discounts}
|
|
|
|
- sku.Activity = []*util.Activity{activity}
|
|
|
|
- return nil, sku
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -219,5 +217,6 @@ func EventRenewalReminder(session *httpsession.Session, userid string, areaCount
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
return nil, nil
|
|
return nil, nil
|
|
}
|
|
}
|