api10.31
This commit is contained in:
25
dao/db/mysql.py
Normal file
25
dao/db/mysql.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from dao.db.util import *
|
||||
|
||||
def get_orders_count():
|
||||
# 在mysql中读取统计订单数量
|
||||
connect = get_connet()
|
||||
sql = "SELECT * FROM order_name_yn LIMIT 100"
|
||||
cursor = connect.cursor()
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchall()
|
||||
cursor.close()
|
||||
connect.close()
|
||||
|
||||
resu = []
|
||||
for row in result:
|
||||
resu.append(
|
||||
{
|
||||
"order_name": row[0],
|
||||
"update_time": row[1],
|
||||
"order_count": row[2]
|
||||
}
|
||||
)
|
||||
|
||||
return resu
|
||||
|
||||
|
Reference in New Issue
Block a user