bugfix
This commit is contained in:
parent
86487cbae1
commit
2d13889a26
10
sqlor/sor.py
10
sqlor/sor.py
@ -166,6 +166,14 @@ class SQLor(object):
|
|||||||
ret = u"""select count(*) rcnt from (%s) rowcount_table""" % sql
|
ret = u"""select count(*) rcnt from (%s) rowcount_table""" % sql
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def sortSQL(self, sql, NS):
|
||||||
|
sort = NS.get('sort',None)
|
||||||
|
if sort is None:
|
||||||
|
return sql
|
||||||
|
if isinstance(sort, list):
|
||||||
|
sort = ','.join(sort)
|
||||||
|
return sql + ' ORDER BY ' + sort
|
||||||
|
|
||||||
def pagingSQL(self,sql,paging,NS):
|
def pagingSQL(self,sql,paging,NS):
|
||||||
"""
|
"""
|
||||||
default it not support paging
|
default it not support paging
|
||||||
@ -622,6 +630,8 @@ class SQLor(object):
|
|||||||
'rows':rows
|
'rows':rows
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
|
if ns.get('sort'):
|
||||||
|
sql = self.sortSQL(sql, ns)
|
||||||
return await self.sqlExe(sql,ns)
|
return await self.sqlExe(sql,ns)
|
||||||
|
|
||||||
async def U(self,tablename,ns):
|
async def U(self,tablename,ns):
|
||||||
|
Loading…
Reference in New Issue
Block a user