feat: add img_calls field for recharge products

This commit is contained in:
RockYang
2023-12-15 16:56:56 +08:00
parent 58f3dd5336
commit dfe808bee7
13 changed files with 83 additions and 41 deletions

View File

@@ -196,6 +196,7 @@ func (h *PaymentHandler) PayQrcode(c *gin.Context) {
remark := types.OrderRemark{
Days: product.Days,
Calls: product.Calls,
ImgCalls: product.ImgCalls,
Name: product.Name,
Price: product.Price,
Discount: product.Discount,
@@ -330,6 +331,12 @@ func (h *PaymentHandler) notify(orderNo string) error {
user.Calls += h.App.SysConfig.VipMonthCalls
}
if remark.ImgCalls > 0 {
user.ImgCalls += remark.ImgCalls
} else {
user.ImgCalls += h.App.SysConfig.VipMonthImgCalls
}
// 更新用户信息
res = h.db.Updates(&user)
if res.Error != nil {