Skip to content

Commit

Permalink
Merge pull request #597 from zhangyangziwo/master
Browse files Browse the repository at this point in the history
修复sqlserver获取总行数为1的问题
  • Loading branch information
chenhg5 committed Apr 23, 2024
2 parents d611d58 + 16835ff commit 31f2736
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/admin/modules/table/default.go
Expand Up @@ -472,7 +472,7 @@ func (tb *DefaultTable) getDataFromDatabase(ctx *context.Context, params paramet
queryStatement = "SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY %s." + placeholder + " %s) as ROWNUMBER_, %s from " +
placeholder + "%s %s %s ) as TMP_ WHERE TMP_.ROWNUMBER_ > ? AND TMP_.ROWNUMBER_ <= ?"
// %s means: table, join table, wheres
countStatement = "select count(*) as [size] from (select count(*) as [size] from " + placeholder + " %s %s %s) src"
countStatement = "select count(*) as [size] from (select 1 as [size] from " + placeholder + " %s %s %s) src"
} else {
// %s means: fields, table, join table, wheres, group by, order by field, order by type
queryStatement = "select %s from " + placeholder + "%s %s %s order by " + placeholder + "." + placeholder + " %s LIMIT ? OFFSET ?"
Expand Down

0 comments on commit 31f2736

Please sign in to comment.