Commit e4c68f16 authored by hujiebin's avatar hujiebin

Merge branch 'feature/cp-new' into feature/3.9.0

parents 264560e6 4a8e3f42
...@@ -32,8 +32,10 @@ type CvCpLevel struct { ...@@ -32,8 +32,10 @@ type CvCpLevel struct {
// 资源等级 // 资源等级
type CvResLevel struct { type CvResLevel struct {
Level cp_e.CpLevel `json:"level"` // 等级 Level cp_e.CpLevel `json:"level"` // 等级
Icon string `json:"icon"` // 等级icon图 Icon string `json:"icon"` // 等级icon图
StartPoints uint32 `json:"startPoints"` // 上个等级所需CP值
EndPoints uint32 `json:"endPoints,omitempty"` // 下个等级所需CP值
} }
// 特权信息 // 特权信息
...@@ -57,12 +59,12 @@ type CvSpace struct { ...@@ -57,12 +59,12 @@ type CvSpace struct {
} }
var CvResLevelList = []CvResLevel{ var CvResLevelList = []CvResLevel{
{cp_e.CpLevel0, cp_e.CpLevelIcon[cp_e.CpLevel0]}, {cp_e.CpLevel0, cp_e.CpLevelIcon[cp_e.CpLevel0], cp_e.CpLevelPoints[cp_e.CpLevel0], cp_e.CpLevelPoints[cp_e.CpLevel1]},
{cp_e.CpLevel1, cp_e.CpLevelIcon[cp_e.CpLevel1]}, {cp_e.CpLevel1, cp_e.CpLevelIcon[cp_e.CpLevel1], cp_e.CpLevelPoints[cp_e.CpLevel1], cp_e.CpLevelPoints[cp_e.CpLevel2]},
{cp_e.CpLevel2, cp_e.CpLevelIcon[cp_e.CpLevel2]}, {cp_e.CpLevel2, cp_e.CpLevelIcon[cp_e.CpLevel2], cp_e.CpLevelPoints[cp_e.CpLevel2], cp_e.CpLevelPoints[cp_e.CpLevel3]},
{cp_e.CpLevel3, cp_e.CpLevelIcon[cp_e.CpLevel3]}, {cp_e.CpLevel3, cp_e.CpLevelIcon[cp_e.CpLevel3], cp_e.CpLevelPoints[cp_e.CpLevel3], cp_e.CpLevelPoints[cp_e.CpLevel4]},
{cp_e.CpLevel4, cp_e.CpLevelIcon[cp_e.CpLevel4]}, {cp_e.CpLevel4, cp_e.CpLevelIcon[cp_e.CpLevel4], cp_e.CpLevelPoints[cp_e.CpLevel4], cp_e.CpLevelPoints[cp_e.CpLevel5]},
{cp_e.CpLevel5, cp_e.CpLevelIcon[cp_e.CpLevel5]}, {cp_e.CpLevel5, cp_e.CpLevelIcon[cp_e.CpLevel5], cp_e.CpLevelPoints[cp_e.CpLevel5], cp_e.CpLevelPoints[cp_e.CpLevelMax]},
} }
var ( var (
......
...@@ -76,6 +76,8 @@ func CpSpace(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -76,6 +76,8 @@ func CpSpace(c *gin.Context) (*mycontext.MyContext, error) {
} }
if cpLevel != cp_e.CpLevelMax { if cpLevel != cp_e.CpLevelMax {
nextPoints = cp_e.CpLevelPoints[cpLevel+1] nextPoints = cp_e.CpLevelPoints[cpLevel+1]
} else {
nextPoints = cp_e.CpLevelPoints[cp_e.CpLevelMax]
} }
userPrivileges, err := cp_m.MGetUserSvipPrivilege(model, []uint64{userId}) userPrivileges, err := cp_m.MGetUserSvipPrivilege(model, []uint64{userId})
if err != nil { if err != nil {
......
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 to comment