|
@@ -0,0 +1,28 @@
|
|
|
+import schedule
|
|
|
+import time
|
|
|
+from common import MysqlHelper, Feishu
|
|
|
+
|
|
|
+
|
|
|
+def select_xng_uid_count():
|
|
|
+ sql = """SELECT COUNT(0) FROM xng_uid WHERE DATE(data_time) = CURDATE();"""
|
|
|
+ data = MysqlHelper.get_values(sql)
|
|
|
+ return data
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+def fs_bot():
|
|
|
+ count = select_xng_uid_count()
|
|
|
+ value = int(count[0][0])
|
|
|
+
|
|
|
+ text = (
|
|
|
+ f"**今日小年糕账号入库量**: {value} 条\n"
|
|
|
+ )
|
|
|
+ Feishu.finish_bot(text, "https://open.feishu.cn/open-apis/bot/v2/hook/d4862d7e-c97d-456a-85ac-763301c0d958",
|
|
|
+ "【 小年糕入库数量每日通知 】")
|
|
|
+
|
|
|
+
|
|
|
+# 每天上午十一点
|
|
|
+schedule.every().day.at("11:00").do(fs_bot)
|
|
|
+while True:
|
|
|
+ schedule.run_pending()
|
|
|
+ time.sleep(1)
|