getmsg.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:DouyuFan 作者: wangmengcn 项目源码 文件源码
def getTaginfo(tag):
    '''
    ???????????????????
    '''
    if tag:
        taginfo = db['kindRecord']
        result = taginfo.find({'tag': tag}, {'_id': 0, 'date': 0}).sort(
            'date', pymongo.DESCENDING).limit(1)
        taganchor = db['Roominfo']
        anchors = taganchor.find(
            {'tag': tag}, {'_id': 0, 'img': 0, 'date': 0, 'tag': 0})
        if anchors.count() != 0:
            anchorsinfo = [{'anchor': item['anchor'], 'audience':item['audience'], 'roomid':item[
                'roomid'], 'roomtitle':item['roomtitle']} for item in anchors]
            if result.count() != 0:
                return result[0], anchorsinfo
            else:
                return None
        else:
            return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号