feat: update slice expr

This commit is contained in:
Rogee
2025-05-26 14:31:41 +08:00
parent d634e0175b
commit 0a8f6f9a1b
5 changed files with 39 additions and 13 deletions

View File

@@ -67,14 +67,10 @@ func (m *Medias) GetByIds(ctx context.Context, ids []int64) ([]*Medias, error) {
return nil, nil
}
condIds := lo.Map(ids, func(id int64, _ int) Expression {
return Int64(id)
})
tbl := tblMedias
stmt := tbl.
SELECT(tbl.AllColumns).
WHERE(tbl.ID.IN(condIds...))
WHERE(tbl.ID.IN(IntExprSlice(ids)...))
m.log().Infof("sql: %s", stmt.DebugSql())
var medias []Medias