2
0

api_title_index.py 458 B

1234567891011121314
  1. from .tool.func import *
  2. def api_title_index_2(conn):
  3. curs = conn.cursor()
  4. if flask.request.args.get('count', '1') == '1':
  5. curs.execute(db_change('select data from other where name = "count_all_title"'))
  6. title_count = curs.fetchall()
  7. if title_count:
  8. return flask.jsonify({ 'count' : title_count[0][0] })
  9. else:
  10. return flask.jsonify({ 'count' : '0' })
  11. else:
  12. return flask.jsonify({})