Exemplo n.º 1
0
def getDataById(id):
    rs = None
    try:
        sql = "select * from gonggaobody WHERE ggId='%s' order BY insertTime;" % id
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 2
0
def qiyexx_eid(**kwargs):
    rs = None
    try:
        sql = "select * from q_psname where qyname='%s';" % (kwargs['qyname'])
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 3
0
def qiyexx(**kwargs):
    rs = None
    try:
        sql = "select * from q_psname where zt is null ORDER BY eid DESC LIMIT 1;"
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 4
0
def getData():
    rs = None
    try:
        sql = "select * from gonggaobody order BY insertTime;"
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 5
0
def getDataByUrl(url):
    rs = None
    try:
        sql = "select count(1) from zhaoping WHERE url='%s';" % url
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 6
0
def selectryurl_ys1(**kwargs):
    rs = None
    try:
        sql = "select ry_num_zd from tbl_fupa_temp where eid='%s';" % kwargs[
            'eid']
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 7
0
def select_xw_nr(**kwargs):
    rs = None
    try:
        sql = f"select * from xw_nr where biaoti='{kwargs['biaoti']}';"
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 8
0
def select_hua(**kwargs):
    rs = None
    try:
        sql = f"select * from hua where shop='{kwargs['shop']}' or diqu='{kwargs['diqu']}';"
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 9
0
def selecttbl_qyname(**kwargs):
    rs = None
    try:
        sql = "select * from tbl_fupa_temp where eid ='%s';" % kwargs["eid"]
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 10
0
def select_qycookie(**kwargs):
    rs = None
    try:
        sql = f"select * from ipo_title where zt='0';"
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 11
0
def selecttbl_qy(**kwargs):
    rs = None
    try:
        sql = "select * from tbl_qy where qyid ='%s';" % kwargs["qyid"]
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 12
0
def jichutoken(**kwargs):
    rs = None
    try:
        sql = "select * from token_ceshi where yxq ='%s';" % kwargs["yxq"]
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 13
0
def select_fj(**kwargs):
    rs = None
    try:

        sql = f"select * from tbl_fj where qyname='{kwargs['qyname']}' and qyurl='{kwargs['qyurl']}';"
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 14
0
def seletoken(**kwargs):
    rs = None
    try:
        sql = "select token from token_ceshi where token ='%s';" % kwargs[
            "token"]
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 15
0
def selecttbl_qy_xm_weizhi(**kwargs):
    rs = None
    try:
        sql = "select * from tbl_qy_xm_weizhi where xmid='%s' and qyid = '%s';" % (
            kwargs["xmid"], kwargs['qyid'])
        sql = sql.replace('\\', '-').replace('\n',
                                             '').replace('\r',
                                                         '').replace('\t', '')
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 16
0
def selecttbl_qy_zz(**kwargs):
    rs = None
    try:
        sql = "select * from tbl_qy_zz where qyid ='%s' and zsh='%s' and zzmc='%s';" % (
            kwargs["qyid"], kwargs["zsh"], kwargs["zzmc"])
        sql = sql.replace('\\', '-').replace('\n',
                                             '').replace('\r',
                                                         '').replace('\t', '')
        rs = dbmysql.first(sql)
        return rs
    except Exception as e:
        util.logger.error(e)
        return rs
Exemplo n.º 17
0
def selecttbl_user_zcxx(**kwargs):
    rs = None
    try:
        sql = "select * from tbl_user_zcxx where zc_dwid ='%s' and userid ='%s' and zclb='%s' and zyyzh='%s' and zc_zy='%s';" % (
            kwargs["zc_dwid"], kwargs["userid"], kwargs["zclb"],
            kwargs["zyyzh"], kwargs["zc_zy"])
        sql = sql.replace('\\', '-').replace('\n',
                                             '').replace('\r',
                                                         '').replace('\t', '')
        rs = dbmysql.first(sql)
        # print(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 18
0
def selecttbl_qiye_user_qyid(**kwargs):
    rs = None
    try:
        sql = "select userid from tbl_user where qyid='%s' and username='******' and sex='%s' and zjlx='%s' and zjhm='%s';" % (
            kwargs["qyid"],
            kwargs["username"],
            kwargs["sex"],
            kwargs["zjlx"],
            kwargs["zjhm"],
        )
        sql = sql.replace('\\', '-').replace('\n',
                                             '').replace('\r',
                                                         '').replace('\t', '')
        rs = dbmysql.first(sql)
    except Exception as e:
        util.logger.error(e)
    return rs
Exemplo n.º 19
0
def fxh():
    try:
        for i in range(1,26): 
            print(i)
            url = "https://dncapi.feixiaohao.com/api/coin/web-coinrank?page=%s&type=0&pagesize=100&webp=1"%i
            a = requests.get(url=url).content.decode()
            b = json.loads(a)
            c = b["data"]
            for cc in c:
                fullname = "%s-%s"%(cc["name"],cc["fullname"])
                print(fullname)
                price = cc["current_price"]
                inserttime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
                opentime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
                sql = "SELECT * FROM feixiaohao where fullname ='%s'"%fullname
                a = dbmysql.first(sql)
                if a == None:
                    sql = "INSERT INTO feixiaohao(fullname,price,inserttime,opentime) VALUES ('%s','%s','%s','%s')"%(fullname,price,inserttime,opentime)
                    dbmysql.execute(sql)
                else:
                    sql = "UPDATE feixiaohao SET price = '%s',opentime = '%s' WHERE fullname =  '%s'"%(price,opentime,fullname)
                    dbmysql.execute(sql)
    except Ellipsis as e:
        print(e)