Commit b86a5d09 authored by hujiebin's avatar hujiebin

过期的话前端展示默认1月后

parent af6513b8
......@@ -51,6 +51,9 @@ func CpSpace(c *gin.Context) (*mycontext.MyContext, error) {
cpRelation, exists := cp_m.GetCpRelation(model, targetUserInfo.ID)
if exists {
level := cp_m.GetCpLevel(model, cpRelation.ID)
if level.ExpireAt.Before(time.Now()) {
level.ExpireAt = time.Now().AddDate(0, 1, 0)
}
cpLevel, curPoints = level.Level, level.Points
expireAtUnix, settlementDate = level.ExpireAt.Unix(), level.ExpireAt.Format("2006-01-02")
cpDays = int(time.Now().Sub(cpRelation.CreatedTime).Hours()/24) + 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