renyupeng 2 năm trước cách đây
mục cha
commit
42bd8c65cf
1 tập tin đã thay đổi với 34 bổ sung0 xóa
  1. 34 0
      utils/cookie_update.py

+ 34 - 0
utils/cookie_update.py

@@ -0,0 +1,34 @@
+# Author renyupeng
+# coding=utf-8
+# @Time    : 2023/2/27 2:16 下午
+# @Site    : 
+# @File    : cookie_update.py
+# @Software: PyCharm
+# @contact: renyupeng@c-top.com.cn
+# @Tel 1501435553
+from utils.mysql_utils import MysqlUtils
+
+
+class cookie_update:
+
+    @staticmethod
+    def get_cookie_handler():
+        sql = "select cookie ,phone_num from kwai_promoter.kuaishou_supply_chain_cookie where status =0"
+        result = MysqlUtils().QueryOne(sql)
+        return result
+
+    @staticmethod
+    def update_cookie_handler(phone_num):
+        sql = "update kwai_promoter.kuaishou_supply_chain_cookie set status=1 where phone_num={phone_num}".format(
+            phone_num=phone_num)
+        MysqlUtils().Operate(sql=sql, params=None, DML=True)
+
+    @staticmethod
+    def update_temporary_cookie_handler(phone_num):
+        sql = "update kwai_promoter.kuaishou_supply_chain_cookie set status=2 where phone_num={phone_num}".format(
+            phone_num=phone_num)
+        MysqlUtils().Operate(sql=sql, params=None, DML=True)
+
+
+if __name__ == '__main__':
+    cookie_update().get_cookie_handler()