Commit 4b15c89c authored by chenweijian's avatar chenweijian

3.9.0

parent fe8c02a6
......@@ -417,6 +417,9 @@ func CpDetailPage(c *gin.Context) (*mycontext.MyContext, error) {
if err != nil {
return myCtx, err
}
if user == nil || user.ID == 0 {
return myCtx, bizerr.InvalidParameter
}
cp, err := cp_m.GetCp(model, user.ID)
if err != nil {
......@@ -434,12 +437,14 @@ func CpDetailPage(c *gin.Context) (*mycontext.MyContext, error) {
res = new(CpDetail)
// 返回值
level := cp_m.GetCpLevel(model, cp.Id)
res.CpLevel = cp_cv.CvCpLevel{
Level: level.Level,
Points: cp_e.CpLevelPoints[level.Level] + level.Points,
StartPoints: cp_e.CpLevelPoints[level.Level],
ExpireAtUnix: level.ExpireAt.Unix(),
SettlementDate: level.ExpireAt.Format(utils.DATE_FORMAT),
if level.ID > 0 {
res.CpLevel = cp_cv.CvCpLevel{
Level: level.Level,
Points: cp_e.CpLevelPoints[level.Level] + level.Points,
StartPoints: cp_e.CpLevelPoints[level.Level],
ExpireAtUnix: level.ExpireAt.Unix(),
SettlementDate: level.ExpireAt.Format(utils.DATE_FORMAT),
}
}
if res.CpLevel.Level != cp_e.CpLevelMax {
res.CpLevel.EndPoints = cp_e.CpLevelPoints[res.CpLevel.Level+1]
......
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