select_dao.py 430 Bytes
Newer Older
lcn's avatar
lcn committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
from pot_libs.mysql_util.mysql_util import MysqlUtil
from pot_libs.settings import SETTING


async def search_dao(sql):
    async with MysqlUtil(db=SETTING.mysql_zhiwei_u_db) as conn:
        data = await conn.fetchall(sql)
    return data


async def total_search_dao(sql):
    """搜索条数 """
    async with MysqlUtil(db=SETTING.mysql_zhiwei_u_db) as conn:
        data = await conn.fetchone(sql)
    return data["total"]