feat: update slice expr
This commit is contained in:
@@ -210,7 +210,7 @@ func (m *Users) GetUsersMapByIDs(ctx context.Context, ids []int64) (map[int64]Us
|
||||
stmt := tbl.
|
||||
SELECT(tbl.AllColumns).
|
||||
WHERE(
|
||||
tbl.ID.IN(lo.Map(ids, func(id int64, _ int) Expression { return Int64(id) })...),
|
||||
tbl.ID.IN(IntExprSlice(ids)...),
|
||||
)
|
||||
|
||||
m.log().Infof("sql: %s", stmt.DebugSql())
|
||||
@@ -231,7 +231,7 @@ func (m *Users) BatchCheckHasBought(ctx context.Context, postIDs []int64) (map[i
|
||||
tbl := tblUserPosts
|
||||
stmt := tbl.SELECT(tbl.PostID.AS("post_id")).WHERE(
|
||||
tbl.UserID.EQ(Int64(m.ID)).AND(
|
||||
tbl.PostID.IN(lo.Map(postIDs, func(id int64, _ int) Expression { return Int64(id) })...),
|
||||
tbl.PostID.IN(IntExprSlice(postIDs)...),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user