diff --git a/consume/egg_canal_user_down_consume.go b/consume/egg_canal_user_down_consume.go index 1efe6bf..9e57c7b 100644 --- a/consume/egg_canal_user_down_consume.go +++ b/consume/egg_canal_user_down_consume.go @@ -58,11 +58,19 @@ func handleEggCanalUserDownConsume(msgData []byte) error { engine := db.Db NewUserDb := implement.NewUserDb(engine) user, _ := NewUserDb.GetUser(utils.StrToInt64(msg.Uid)) + if user == nil { + return nil + } levelDb := implement.NewUserLevelDb(engine) levelAll, _ := levelDb.UserLevelAllByAsc() level := 1 - if len(levelAll) > 0 { - level = levelAll[0].Id + if len(levelAll) == 0 { + return nil + + } + level = levelAll[0].Id + if levelAll[0].Id == user.Level { + return nil } sort.Slice(levelAll, func(i, j int) bool { return levelAll[i].LevelWeight > levelAll[j].LevelWeight