feat: 数据查询完善-支持直接选择列输入值过滤数据

This commit is contained in:
meilin.huang
2022-04-24 20:26:58 +08:00
parent 41c660894c
commit 6fe892ca9f
6 changed files with 71 additions and 14 deletions

View File

@@ -179,7 +179,7 @@ func GetPageBySql(sql string, param *PageParam, toModel interface{}, args ...int
return &PageResult{Total: 0, List: []string{}}
}
// 分页查询
limitSql := sql + " LIMIT " + strconv.Itoa(param.PageNum-1) + ", " + strconv.Itoa(param.PageSize)
limitSql := sql + " LIMIT " + strconv.Itoa((param.PageNum-1)*param.PageSize) + ", " + strconv.Itoa(param.PageSize)
err = db.Raw(limitSql).Scan(toModel).Error
biz.ErrIsNil(err, "查询失败: %s")
return &PageResult{Total: int64(count), List: toModel}