diff --git a/dinner.py b/dinner.py index 597d978..53d006e 100644 --- a/dinner.py +++ b/dinner.py @@ -101,14 +101,21 @@ def dinner(): else: menu = {} summary = fetch_menu_summary() - result = fetch_roll_result() last_result = fetch_roll_result(-1) + for x in summary: + if x == last_result: + summary[x] = summary[x] * 7 / 10 + total_vote = sum(value for value in summary.values()) + if total_vote == 0: + total_vote = 1 + result = fetch_roll_result() can_roll = (check_roll() == 1) all_choice = list(map(lambda x: {'name': x[0], 'label': x[1]}, fetch_all_menu())) return render_template('dinner.html', all_choice=all_choice, menu=menu, summary=summary, + total_vote=total_vote, result=result, can_roll=can_roll, last_result=last_result) diff --git a/templates/dinner.html b/templates/dinner.html index 27abfea..2ed0781 100644 --- a/templates/dinner.html +++ b/templates/dinner.html @@ -9,7 +9,7 @@
每天8:00-17:30间开放匿名投票更新,17:30以后允许发起抽签,抽签结果确定后不可更改
随机抽签,按得票数决定中签概率
{% if last_result %} -今日{{ last_result }}中签概率降低30%
+今日{{ last_result }}最终得票数降低30%
{% endif %}