cookie_update.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Author renyupeng
  2. # coding=utf-8
  3. # @Time : 2023/2/27 2:16 下午
  4. # @Site :
  5. # @File : cookie_update.py
  6. # @Software: PyCharm
  7. # @contact: renyupeng@c-top.com.cn
  8. # @Tel 1501435553
  9. from utils.mysql_utils import MysqlUtils
  10. class cookie_update:
  11. @staticmethod
  12. def get_cookie_handler():
  13. sql = "select cookie ,phone_num from kwai_promoter.kuaishou_supply_chain_cookie where status =0"
  14. result = MysqlUtils().QueryOne(sql)
  15. return result
  16. @staticmethod
  17. def update_cookie_handler(phone_num):
  18. sql = "update kwai_promoter.kuaishou_supply_chain_cookie set status=1 where phone_num={phone_num}".format(
  19. phone_num=phone_num)
  20. MysqlUtils().Operate(sql=sql, params=None, DML=True)
  21. @staticmethod
  22. def update_temporary_cookie_handler(phone_num):
  23. sql = "update kwai_promoter.kuaishou_supply_chain_cookie set status=2 where phone_num={phone_num}".format(
  24. phone_num=phone_num)
  25. MysqlUtils().Operate(sql=sql, params=None, DML=True)
  26. if __name__ == '__main__':
  27. cookie_update().get_cookie_handler()