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.

13 lines
596 B

7 days ago
import io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import pymysql
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 id, menu_name, menu_type, perms, path FROM sys_menu WHERE perms LIKE '%opportunity%' AND deleted=0 LIMIT 40")
for r in cur.fetchall():
print('MENU:', r)
cur.execute("SELECT COUNT(*) FROM sys_menu WHERE perms LIKE '%opportunity%'")
print('total opp perms:', cur.fetchone()[0])
conn.close()