web-backend/dao/db/mysql.py
2025-01-03 10:31:30 +08:00

26 lines
529 B
Python

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