Exemplo n.º 1
0
def show_index():
    refreshLocalDbDay()
    myData = s_data_numbyday.query.filter(
        s_data_numbyday.usertolnum > 0).order_by(db.desc(
            s_data_numbyday.time)).all()

    now = time.time()
    secDay = 3600 * 24
    todayUser = s_plat_user.query.filter(
        s_plat_user.regTime > myData[0].time + secDay).filter(
            s_plat_user.regTime < now).count()
    todayGame = s_plat_fightlog.query.filter(
        s_plat_fightlog.logTime > myData[0].time + secDay).filter(
            s_plat_fightlog.logTime < now).count()

    gdusers = s_plat_user.query.all()
    gsusers = s_plat_user.query.filter(s_plat_user.wxid.like("player_%")).all()

    tol_user = len(gdusers)
    tol_guest = len(gsusers)
    tol_wechat = tol_user - tol_guest
    gdgames = s_plat_fightlog.query.all()
    tol_game = len(gdgames)
    return render_template('index.html',
                           tol_user=tol_user,
                           tol_wechat=tol_wechat,
                           tol_guest=tol_guest,
                           tol_game=tol_game,
                           todayUser=todayUser,
                           todayGame=todayGame,
                           datas=myData[0:4])
Exemplo n.º 2
0
def dayUpUserListPage(page):
    refreshLocalDbDay()
    myData = s_data_numbyday.query.filter(
        s_data_numbyday.usertolnum > 0).order_by(db.desc(
            s_data_numbyday.time)).all()
    tol_item = len(myData)
    tol_page = int(math.ceil(tol_item / 20.0))
    cur_page = page
    return render_template('dayUpUserList.html',
                           users=myData[20 * page - 20:20 * page],
                           cur_page=cur_page,
                           tol_page=tol_page)
Exemplo n.º 3
0
def gameDiagram():
    refreshLocalDbDay()
    myData = s_data_numbyday.query.filter(
        s_data_numbyday.usertolnum > 0).order_by(s_data_numbyday.time).all()
    return render_template('gameDiagram.html', datas=myData)