# -*- coding: utf-8 -*- """票 06 前置探针:区域/属地 code 样例 + opportunity 相关列确认。""" 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 province_code, city_code, locality_type, primary_customer_id, current_stage_id " "FROM opportunity WHERE deleted=0 LIMIT 3") print('[opp sample]', cur.fetchall()) cur.execute("SHOW COLUMNS FROM opportunity LIKE 'scheme%'") print('[scheme cols]', cur.fetchall()) cur.execute("SHOW COLUMNS FROM opportunity_oplog") print('[oplog cols]', [(r[0], r[1]) for r in cur.fetchall()]) conn.close()