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 new_star_list(): 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""") result = db.engine.execute(sql) data = result.fetchall() return render_template('hw/rank.html', data=data, nav=nav)