Commit f9e06342 by CalciumIon

fix: resolve pricing calculation issue (#659)

parent fe29ca04
...@@ -10,18 +10,16 @@ func GetPricing(c *gin.Context) { ...@@ -10,18 +10,16 @@ func GetPricing(c *gin.Context) {
pricing := model.GetPricing() pricing := model.GetPricing()
userId, exists := c.Get("id") userId, exists := c.Get("id")
usableGroup := map[string]string{} usableGroup := map[string]string{}
groupRatio := common.GroupRatio groupRatio := map[string]float64{}
for s, f := range common.GroupRatio {
groupRatio[s] = f
}
var group string var group string
if exists { if exists {
user, err := model.GetChannelById(userId.(int), false) user, err := model.GetChannelById(userId.(int), false)
if err != nil { if err == nil {
c.JSON(200, gin.H{ group = user.Group
"success": false,
"message": err.Error(),
})
return
} }
group = user.Group
} }
usableGroup = common.GetUserUsableGroups(group) usableGroup = common.GetUserUsableGroups(group)
......
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