瀏覽代碼

增加写入时间

zhangyong 8 月之前
父節點
當前提交
d338bd08e1
共有 2 個文件被更改,包括 9 次插入3 次删除
  1. 4 2
      common/sql_help.py
  2. 5 1
      xssy_channel/sph_nrxs.py

+ 4 - 2
common/sql_help.py

@@ -264,18 +264,20 @@ class sqlCollect():
     @classmethod
     def insert_user_data(cls, uid, name, account_id, channel, status):
         insert_sql = f"""INSERT INTO machine_making_traceability (old_account_id, name, new_account_id, channel, status) values ("{uid}", "{name}","{account_id}","{channel}", {status})"""
-        MysqlHelper.update_values(
+        res = MysqlHelper.update_values(
             sql=insert_sql
         )
+        return res
 
 
     """相似溯源-视频号数据插入"""
     @classmethod
     def insert_xssy_sph_info(cls, account_user: str, traceable_user: str, traceable_user_v2: str,  has_used: str, appid:Optional[str] = None, pq_id:Optional[str] = None):
         insert_sql = f"""INSERT INTO xssy_sph (account_user, traceable_user, traceable_user_v2, pq_id, has_used, appid) values ("{account_user}", "{traceable_user}","{traceable_user_v2}","{pq_id}", {has_used},"{appid}")"""
-        MysqlHelper.update_values(
+        res = MysqlHelper.update_values(
             sql=insert_sql
         )
+        return res
 
     """查询该账号是否存在"""
     @classmethod

+ 5 - 1
xssy_channel/sph_nrxs.py

@@ -1,5 +1,6 @@
 import random
 import time
+from datetime import datetime
 
 import requests
 import json
@@ -270,6 +271,8 @@ class SphNrxs:
                             #         if has_used == '0':
                             res = sqlCollect.insert_xssy_sph_info(uid, nick_name, user_name, "0", "", pq_id)
                             if res == 1:
+                                current_time = datetime.now()
+                                formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
                                 values = [
                                     [
                                         "视频号",
@@ -282,7 +285,8 @@ class SphNrxs:
                                         "",
                                         "AI标题",
                                         "",
-                                        f"溯源账号:{uid}"
+                                        f"溯源账号:{uid}",
+                                        formatted_time
                                     ]
                                 ]
                                 Feishu.insert_columns("WGIYsSDdxhItBwtJ0xgc0yE7nEg", '0701bd', "ROWS", 1, 2)