#!/usr/bin/env python
# -*- coding:utf-8 -*- 
# Author: hj
# softWare:pycharm
# fileName:consultation_record_dao.py
# createTime:2020/7/6 14:51

from db.mod_db import DataBase


class consultation_Dao:
    def __init__(self, db=None):
        if db is None:
            self.dataBase = DataBase()
        else:
            self.dataBase = db
    def select_sql(self,standard_company_name):
        return self.dataBase.fetch_all('SELECT DATE_FORMAT(create_time, "%%Y-%%m-%%d %%T") as create_time, id,customer_name,source, consult_product, address FROM `consulting_customer_fq` WHERE standard_company_name = "%s" ORDER BY create_time DESC'%(standard_company_name))


