fix: group update issues

This commit is contained in:
Rogee
2024-09-03 09:45:51 +08:00
parent df2ca18f19
commit 1ed08159a3

View File

@@ -155,7 +155,7 @@ func (c *DBChannel) SaveMessage(ctx context.Context, msg *ChannelMessage) error
// 如果找到记录,那么更新记录
stmt := tbl.UPDATE().SET(
tbl.Content.SET(RawString(`CONCAT(content, #var)`, RawArgs{
tbl.Content.SET(RawString(`CONCAT(content, #var::varchar)`, RawArgs{
"#var": *message.Content,
})),
tbl.Media.SET(RawString(`media || #var::jsonb`, RawArgs{
@@ -167,7 +167,8 @@ func (c *DBChannel) SaveMessage(ctx context.Context, msg *ChannelMessage) error
),
)
_, err = db.ExecContext(ctx, stmt.DebugSql())
_, err = stmt.ExecContext(ctx, db)
// _, err = db.ExecContext(ctx, stmt.DebugSql())
return err
}