系统大量出现where("id",xx) fields("user_id") 固定字符串,修改按照统一规范使用dao.xxx.Columns().xxx

This commit is contained in:
ss
2025-04-21 17:46:06 +08:00
parent 0c5b27d864
commit 19c0c0c1bc
34 changed files with 272 additions and 227 deletions

View File

@@ -207,7 +207,8 @@ func (s *sSysConfig) GetConfigByGroup(ctx context.Context, in *sysin.GetConfigIn
}
var models []*entity.SysConfig
if err = dao.SysConfig.Ctx(ctx).Fields("key", "value", "type").Where("group", in.Group).Scan(&models); err != nil {
cols := dao.SysConfig.Columns()
if err = dao.SysConfig.Ctx(ctx).Fields(cols.Key, cols.Value, cols.Type).Where(cols.Group, in.Group).Scan(&models); err != nil {
err = gerror.Wrapf(err, "获取配置分组[ %v ]失败,请稍后重试!", in.Group)
return
}