#!/usr/bin/env python3
import sqlite3

# 连接数据库
db_path = r'\\ll\D\xtrssvjj\db\dpd.db'
try:
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()
    
    # 查询 ads 表的结构
    print("ads 表字段:")
    cursor.execute('PRAGMA table_info(ads)')
    for row in cursor.fetchall():
        print(row)
    
    # 检查是否有包含 'tot' 的字段
    print("\n检查是否包含 'tot' 的字段:")
    cursor.execute('PRAGMA table_info(ads)')
    found = False
    for row in cursor.fetchall():
        field_name = row[1]
        if 'tot' in field_name.lower():
            print(f"找到包含 'tot' 的字段: {field_name}")
            found = True
    
    if not found:
        print("未找到包含 'tot' 的字段")
        
finally:
    if conn:
        conn.close()