Skip to content

Commit

Permalink
优化后台查看数据总数的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
wenguonideshou authored Jul 17, 2018
1 parent 319d85f commit 5152c9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ def index(self):
return redirect(url_for('admin.login_view'))
connzsky = pymysql.connect(host=DB_HOST,port=DB_PORT_MYSQL,user=DB_USER,password=DB_PASS,db=DB_NAME_MYSQL,charset=DB_CHARSET,cursorclass=pymysql.cursors.DictCursor)
currzsky = connzsky.cursor()
totalsql = 'select count(id) from search_hash'
totalsql = 'select max(id) from search_hash'
currzsky.execute(totalsql)
totalcounts=currzsky.fetchall()
total=int(totalcounts[0]['count(id)'])
total=int(totalcounts[0]['max(id)'])
todaysql='select count(id) from search_hash where to_days(search_hash.create_time)= to_days(now())'
currzsky.execute(todaysql)
todaycounts=currzsky.fetchall()
Expand Down

0 comments on commit 5152c9c

Please sign in to comment.