增加了会员配置首单优惠价格
This commit is contained in:
@@ -157,6 +157,21 @@ func (b *SystemMember) PutSystemMember(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// 首单优惠价格
|
||||
if req.FirstTimePrice != nil {
|
||||
if systemMember.FirstTimePrice == nil {
|
||||
systemMemberData["first_time_price"] = req.FirstTimePrice
|
||||
} else {
|
||||
if *req.FirstTimePrice != *systemMember.FirstTimePrice {
|
||||
systemMemberData["first_time_price"] = req.FirstTimePrice
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if systemMember.FirstTimePrice != nil {
|
||||
systemMemberData["first_time_price"] = nil
|
||||
}
|
||||
}
|
||||
|
||||
// 开始事务
|
||||
tx := global.Db.Begin()
|
||||
defer func() {
|
||||
@@ -214,9 +229,10 @@ func (b *SystemMember) AddSystemMember(c *gin.Context) {
|
||||
}()
|
||||
|
||||
systemMember := &model.SystemMember{
|
||||
MemberDays: req.MemberDays,
|
||||
Price: req.Price,
|
||||
DiscountPrice: req.DiscountPrice,
|
||||
MemberDays: req.MemberDays,
|
||||
Price: req.Price,
|
||||
DiscountPrice: req.DiscountPrice,
|
||||
FirstTimePrice: req.FirstTimePrice,
|
||||
}
|
||||
|
||||
// 处理优惠截止时间
|
||||
|
||||
Reference in New Issue
Block a user