|
|
@@ -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 |
|
|
|