Feat: vas for score

This commit is contained in:
HFO4
2020-02-17 09:48:39 +08:00
parent e38a60ea44
commit ca0f244109
7 changed files with 39 additions and 17 deletions

View File

@@ -58,16 +58,21 @@ func NewOrder(pack *serializer.PackProduct, group *serializer.GroupProducts, num
title string
price int
)
if pack == nil {
if pack != nil {
orderType = model.PackOrderType
productID = pack.ID
title = pack.Name
price = pack.Price
} else if group != nil {
orderType = model.GroupOrderType
productID = group.ID
title = group.Name
price = group.Price
} else {
orderType = model.PackOrderType
productID = pack.ID
title = pack.Name
price = pack.Price
orderType = model.ScoreOrderType
productID = 0
title = fmt.Sprintf("%d 积分", num)
price = model.GetIntSetting("score_price", 1)
}
// 创建订单记录