import math from flask import Blueprint, jsonify, request from flask import render_template from sqlalchemy import not_, and_, or_, text, select from ..model import HuaWei # 导入上级模块 from app import db hw = Blueprint('hw', __name__, url_prefix='/hw') nav = dict(); nav['hw'] = 'active' @hw.route('/rank')
def hua_wei():
sql = text("""select * from ( select ydcomm_blog_author,blogs_author_info,count(id) as s from huawei where blogs_create_time like "2023/01%" GROUP BY blogs_author_info ) b
ORDER BY b.s desc limit 31""")
result = db.engine.execute(sql) data = result.fetchall() return render_template('hw/rank.html', data=data, nav=nav)