diff --git a/cv/cp_cv/cp.go b/cv/cp_cv/cp.go index 4525dd34ec16b217c40fc2b06f59d98eefb2e7fe..7978fd31894360dcbf045ff99a0567d7a26660ba 100644 --- a/cv/cp_cv/cp.go +++ b/cv/cp_cv/cp.go @@ -7,6 +7,8 @@ type CvCp struct { CpUserInfo *user_cv.CvUserBase `json:"cpUserInfo"` // cp用户信息 CpLevel CvCpLevel `json:"cpLevel"` // cp等级 MyPrivilegeList []CvPrivilege `json:"myPrivilegeList"` // 等级特权 + CreatedUnix int64 `json:"createdUnix"` // cp创建时间 + CpDays int `json:"cpDays"` // cp天数 } // cp关系 diff --git a/route/user_r/inner.go b/route/user_r/inner.go index 24d4cfbc72586f3f8f2143e5be985a5b2eda4a5b..1fe9ea38ed171371f55072ae11b453d0b9973a3a 100644 --- a/route/user_r/inner.go +++ b/route/user_r/inner.go @@ -157,6 +157,8 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) { Level: cpLevel, }, MyPrivilegeList: myPrivilegeList, + CpDays: int(time.Now().Sub(cpRelation.CreatedTime).Hours()/24) + 1, + CreatedUnix: cpRelation.CreatedTime.Unix(), } resp.ResponseOk(c, response) return myContext, nil