Пример #1
0
def index():
    db = get_db().cursor()

    db.execute("SELECT * FROM multi ORDER BY id DESC LIMIT(1)")
    latest = db.fetchone()["date"]

    return render_template('multi/search_results.html', latest=latest)
Пример #2
0
def date():
    db = get_db().cursor()

    day = request.args.get('day') or '%'
    month = request.args.get('month') or '%'
    year = request.args.get('year') or '%'

    searched_date = ".".join([day, month, year])

    db.execute("SELECT id, date, CONCAT_WS(' ', l1, l2, l3, l4, l5, l6) AS lotto, "
               "CONCAT_WS(' ', p1, p2, p3, p4, p5, p6) AS plus FROM lotto WHERE date LIKE %s", (searched_date,))
    results = db.fetchall()

    return render_template('lotto/search_results.html', results=results or [], size=len(results))
Пример #3
0
def date():
    db = get_db().cursor()

    day = request.args.get('day') or '%'
    month = request.args.get('month') or '%'
    year = request.args.get('year') or '%'

    searched_date = ".".join([day, month, year])

    db.execute(
        "SELECT date, plus, CONCAT_WS(' ', m1, m2, m3, m4, m5, m7, m8, m9, m10,"
        " m11, m12, m13, m14, m15, m16, m17, m18, m19, m20) AS multi "
        "FROM multi WHERE date LIKE %s", (searched_date, ))
    results = db.fetchall()

    return render_template('multi/search_results.html',
                           results=results or [],
                           size=len(results))
Пример #4
0
 def wrapper(*args, **kwargs):
     with get_db() as conn:
         with conn.cursor() as cur:
             res = func(cur, *args, **kwargs)
     return res