This commit is contained in:
yumoqing 2024-03-06 18:05:35 +08:00
parent 3b93287c3e
commit e09112460f
2 changed files with 5 additions and 6 deletions

View File

@ -72,7 +72,8 @@ class MySqlor(SQLor):
return tuple(d)
def pagingSQLmodel(self):
return u"""select * from (%s) A order by $[sort]$
return """select * row_number() over(order by $[sort]$) as row_num_ from (%s) A limit $[from_line]$, $[rows]$"""
return """select * from (%s) A order by $[sort]$
limit $[from_line]$,$[rows]$"""
def tablesSQL(self):

View File

@ -144,7 +144,7 @@ class SQLor(object):
return name=='sqlor'
def pagingSQLmodel(self):
return u""
return ""
def placeHolder(self,varname,pos=None):
if varname=='__mainsql__' :
@ -194,8 +194,7 @@ class SQLor(object):
'from_line':from_line,
'end_line':end_line,
'rows':rows,
'sort':sort,
'order':'',
'sort':sort
}
ac = ArgsConvert('$[',']$')
psql = ac.convert(psql,ns)
@ -415,8 +414,7 @@ class SQLor(object):
"paging":{
"rowsname":"rows",
"pagename":"page",
"sortname":"sort",
"ordername":"order"
"sortname":"sort"
}
})
if desc.get('sortfield',False):