# -*- coding: utf-8 -*- """票 06 排障:查商机A 字段现状 + 运行日志尾部(submit 50001 堆栈)。""" import io, sys import pymysql sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456', database='crm', charset='utf8mb4', autocommit=True) cur = conn.cursor() cur.execute("SELECT opp_name, opp_source, bid_form, province_code, city_code, locality_type, " "primary_customer_id, opp_status FROM opportunity WHERE id=749194015018057728") print('[opp A now]', cur.fetchall()) cur.execute("SELECT id, card_status, scheme_budget, customer_id, delete_key, deleted " "FROM opportunity_scheme_card WHERE opp_id=749194015018057728") print('[cards]', cur.fetchall()) conn.close() print('\n--- t04-run.log tail ---') txt = open(r'e:/code/crm-backend-matt/logs/t04-run.log', encoding='utf-8', errors='replace').read() print('len=', len(txt)) print(txt[-4000:])