From b0745aa420788bc350c54f11ddc0f1ddebd6e8ef Mon Sep 17 00:00:00 2001 From: Franklin-F Date: Sun, 8 Jun 2025 20:43:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E4=B8=BE=E6=8A=A5=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E8=B0=83=E6=95=B4=E6=89=B9=E6=AC=A1=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB.py | 16 +++++++++++----- mysql_to_xlsx.py | 4 ++-- update_video_tsstatus.py | 10 ++++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 update_video_tsstatus.py diff --git a/DB.py b/DB.py index a1837f0..2fd72e4 100644 --- a/DB.py +++ b/DB.py @@ -309,7 +309,6 @@ class DBVidcon: self.redis.lpush(self.l2_list_key, *raws) logger.info(f"[回滚l2] 已退回 {len(raws)} 条") - @mysql_retry() def get_report_video(self): sql = """ @@ -341,10 +340,17 @@ class DBVidcon: now_ts = int(time.time()) self.cursor.execute(sql, (new_status, errinfo, now_ts, record_id)) - - - - + @mysql_retry() + def update_video_ts_status(self): + sql = """ + UPDATE sh_dm_video_v2 v +JOIN sh_dm_video_author a ON v.u_xid = a.u_xid +SET v.ts_status = 3 +WHERE a.white_status = 1; + """ + self.cursor.execute(sql) + self.flush() + logger.info("[更新视频举报状态] 已执行完毕") @mysql_retry() def upsert_video(self, data: dict): diff --git a/mysql_to_xlsx.py b/mysql_to_xlsx.py index 0a55ed0..742ba2d 100644 --- a/mysql_to_xlsx.py +++ b/mysql_to_xlsx.py @@ -98,9 +98,9 @@ def fetch_all_data_for_rn(rn: str, batches: list[int]) -> pd.DataFrame: def export_all(): # 指定要处理的批次 - batches = [1747324254, 1747323990] + batches = [1748965168, 1749049335] # 先更新 is_repeat - update_is_repeat(batches) + # update_is_repeat(batches) rn_list = get_rn_list() timestamp = datetime.now().strftime("%Y%m%d") diff --git a/update_video_tsstatus.py b/update_video_tsstatus.py new file mode 100644 index 0000000..0a44200 --- /dev/null +++ b/update_video_tsstatus.py @@ -0,0 +1,10 @@ +from DB import DBVidcon +from logger import logger + + +db = DBVidcon() + +logger.info("开始更新视频举报状态") +db.update_video_ts_status() +db.close() +logger.info("更改视频举报状态完成") \ No newline at end of file