You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
1.0 KiB

2 days ago
# -*- coding: utf-8 -*-
import pymysql
conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456',
database='crm', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)
with conn.cursor() as cur:
cur.execute('SELECT leader_user_id FROM sys_dept WHERE id=744700334353416192')
print('dept leader restored:', cur.fetchall())
cur.execute('SELECT dept_id FROM crm_auth_user WHERE id=744842318024015872')
print('BUDDY dept restored:', cur.fetchall())
cur.execute("SELECT COUNT(*) c FROM customer WHERE owner_user_id=744842318024015872 AND deleted=0 AND archive_status=1")
print('BUDDY active owned:', cur.fetchall())
cur.execute("SELECT COUNT(*) c FROM customer WHERE customer_name LIKE 'e2c-r3d%'")
print('residual fixtures:', cur.fetchall())
cur.execute("SELECT COUNT(*) c FROM customer_transfer WHERE from_user_id=744842318024015872 AND create_time>=CURDATE()")
print('residual BUDDY transfers today:', cur.fetchall())
conn.close()