feat: update slice expr
This commit is contained in:
@@ -125,7 +125,7 @@ func (m *Posts) BoughtStatistics(ctx context.Context, postIds []int64) (map[int6
|
||||
tbl.PostID.AS("post_id"),
|
||||
).
|
||||
WHERE(
|
||||
tbl.PostID.IN(lo.Map(postIds, func(id int64, _ int) Expression { return Int64(id) })...),
|
||||
tbl.PostID.IN(IntExprSlice(postIds)...),
|
||||
).
|
||||
GROUP_BY(
|
||||
tbl.PostID,
|
||||
@@ -218,7 +218,7 @@ func (m *Posts) GetPostsMapByIDs(ctx context.Context, ids []int64) (map[int64]Po
|
||||
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())
|
||||
@@ -245,7 +245,7 @@ func (m *Posts) GetMediaByIds(ctx context.Context, ids []int64) ([]Medias, error
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user