Commit 417c61bc authored by iamhujiebin's avatar iamhujiebin

fix

parent dec0f08d
...@@ -74,7 +74,7 @@ func BatchGetVips(userIds []uint64) (map[uint64]*int64, error) { ...@@ -74,7 +74,7 @@ func BatchGetVips(userIds []uint64) (map[uint64]*int64, error) {
end = len(userIds) end = len(userIds)
} }
tmp := make([]UserVip, 0) tmp := make([]UserVip, 0)
err := mysql.Db.Where("user_id IN ?", userIds).Find(&tmp).Error err := mysql.Db.Where("user_id IN ?", userIds[start:end]).Find(&tmp).Error
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -17,7 +17,7 @@ func TestGetUserMap(t *testing.T) { ...@@ -17,7 +17,7 @@ func TestGetUserMap(t *testing.T) {
func TestGetUserVipMap(t *testing.T) { func TestGetUserVipMap(t *testing.T) {
var userIds []uint64 var userIds []uint64
for i := 0; i < 15000; i++ { for i := 0; i < 1500; i++ {
userIds = append(userIds, 7642) userIds = append(userIds, 7642)
} }
res, err := user_m.BatchGetVips(userIds) res, err := user_m.BatchGetVips(userIds)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment