importmathfromflaskimportBlueprint,jsonify,requestfromflaskimportrender_templatefromsqlalchemyimportnot_,and_,or_,text,selectfrom..modelimportHuaWei# 导入上级模块fromappimportdbhw=Blueprint('hw',__name__,url_prefix='/hw')nav=dict();nav['hw']='active'@hw.route('/rank')defnew_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()returnrender_template('hw/rank.html',data=data,nav=nav)