|
@@ -4,24 +4,14 @@ def api_recent_change_2(conn):
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
|
|
|
|
|
|
num = int(number_check(flask.request.args.get('num', '10')))
|
|
num = int(number_check(flask.request.args.get('num', '10')))
|
|
|
- if not num > 0:
|
|
|
|
|
- num = 1
|
|
|
|
|
-
|
|
|
|
|
- if num > 1000:
|
|
|
|
|
- num = 1
|
|
|
|
|
-
|
|
|
|
|
- page = int(number_check(flask.request.args.get('page', '1')))
|
|
|
|
|
- if page * num > 0:
|
|
|
|
|
- page = page * num - num
|
|
|
|
|
- else:
|
|
|
|
|
- page = 0
|
|
|
|
|
|
|
+ num = 50 if (1 if not num > 0 else num) > 50 else num
|
|
|
|
|
|
|
|
curs.execute(db_change('' + \
|
|
curs.execute(db_change('' + \
|
|
|
'select id, title, date, ip, send, leng from history ' + \
|
|
'select id, title, date, ip, send, leng from history ' + \
|
|
|
"where not title like 'user:%' " + \
|
|
"where not title like 'user:%' " + \
|
|
|
'order by date desc ' + \
|
|
'order by date desc ' + \
|
|
|
- 'limit ?, ?' + \
|
|
|
|
|
- ''), [page, num])
|
|
|
|
|
|
|
+ 'limit ?' + \
|
|
|
|
|
+ ''), [num])
|
|
|
all_list = curs.fetchall()
|
|
all_list = curs.fetchall()
|
|
|
if all_list:
|
|
if all_list:
|
|
|
return flask.jsonify(all_list)
|
|
return flask.jsonify(all_list)
|