refactor: param int
This commit is contained in:
parent
9cadffd46f
commit
c7b7e919ed
|
|
@ -19,6 +19,10 @@ func (p Params) Str(key string) string {
|
|||
return cast.ToString(p[key])
|
||||
}
|
||||
|
||||
func (p Params) Int(key string) int {
|
||||
return cast.ToInt(p[key])
|
||||
}
|
||||
|
||||
type User struct {
|
||||
sess *session.ApiSession
|
||||
params Params
|
||||
|
|
@ -82,7 +86,7 @@ func (u *User) VipCheck() *response.Response {
|
|||
return nil
|
||||
}
|
||||
|
||||
free := time.Unix(u.sess.GetUserInfo().ActiveTime, 0).AddDate(0, 0, cast.ToInt(u.params[config.ServiceFreeDay])).Unix()
|
||||
free := time.Unix(u.sess.GetUserInfo().ActiveTime, 0).AddDate(0, 0, u.params.Int(config.ServiceFreeDay)).Unix()
|
||||
if free-u.sess.GetUserInfo().ActiveTime > 0 {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue