feat: general:l查询总数时,去掉limit offset条件
This commit is contained in:
@@ -399,7 +399,7 @@ def build_query_sql(query_config, module_config):
|
|||||||
|
|
||||||
query_config_all = get_value(query_config, 'all', False)
|
query_config_all = get_value(query_config, 'all', False)
|
||||||
|
|
||||||
if not query_config_all:
|
if not query_config_all and not query_config_only_count:
|
||||||
sqls.append("limit ?,?")
|
sqls.append("limit ?,?")
|
||||||
values.extend([
|
values.extend([
|
||||||
get_value(query_config, 'offset', 0),
|
get_value(query_config, 'offset', 0),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ async def list(session: AsyncSessionDep, query_config, module_config, debug_data
|
|||||||
|
|
||||||
if n_only_count:
|
if n_only_count:
|
||||||
return {
|
return {
|
||||||
"total": result[0]['total']
|
"total": int(result[0]['total'])
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
has_next = False if get_value(query_config, 'all', False) else len(result) == n_size + 1
|
has_next = False if get_value(query_config, 'all', False) else len(result) == n_size + 1
|
||||||
|
|||||||
Reference in New Issue
Block a user