bugfix: created_at -> create_at for rdb.user table (#632)

This commit is contained in:
yubo 2021-03-24 19:10:01 +08:00 committed by GitHub
parent be9d6ac660
commit c1241fdfbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -373,7 +373,7 @@ func (p *Authenticator) updateUserStatus() {
now := time.Now().Unix()
if p.frozenTime > 0 {
// 3个月以上未登录用户自动变为休眠状态
if _, err := models.DB["rdb"].Exec("update user set status=?, updated_at=?, locked_at=? where ((logged_at > 0 and logged_at<?) or (logged_at = 0 and created_at < ?)) and status in (?,?,?)",
if _, err := models.DB["rdb"].Exec("update user set status=?, updated_at=?, locked_at=? where ((logged_at > 0 and logged_at<?) or (logged_at = 0 and create_at < ?)) and status in (?,?,?)",
models.USER_S_FROZEN, now, now, now-p.frozenTime,
models.USER_S_ACTIVE, models.USER_S_INACTIVE, models.USER_S_LOCKED); err != nil {
logger.Errorf("update user status error %s", err)