diff --git a/src/dao.py b/src/dao.py index e6780f7..8d3784b 100644 --- a/src/dao.py +++ b/src/dao.py @@ -178,8 +178,6 @@ def fetch_roll_result_list(interval: int = 0, limit: int = 3) -> Generator[str, row = cursor.fetchone() while row is not None: yield row[0] - if interval != 0: - return row = cursor.fetchone() finally: cursor.close() diff --git a/src/dinner.py b/src/dinner.py index 077001a..b81ce4f 100644 --- a/src/dinner.py +++ b/src/dinner.py @@ -74,7 +74,7 @@ def vote_reduce(summary: dict[str, float], limit: int = 2) -> tuple[dict[str, fl # 昨日中签项降低权重 for i, last_result in enumerate(last_results): if last_result in summary: - summary[last_result] = summary[last_result] * (9 - i) / 10 + summary[last_result] = summary[last_result] * (8 - i) / 10 total_vote = sum(value for value in summary.values()) return summary, total_vote, last_results @@ -163,6 +163,8 @@ def dinner(): summary_keys = list(filter(lambda x: x in summary.keys(), map(lambda y: y['name'], all_choice))) if not result: predict_result = roll_logic(check=True) + else: + predict_result = None return render_template('dinner.html', all_choice=all_choice, menu=menu, diff --git a/templates/dinner.html b/templates/dinner.html index 2ebe423..6d92733 100644 --- a/templates/dinner.html +++ b/templates/dinner.html @@ -9,7 +9,7 @@

每天8:00-17:30间开放匿名投票更新,17:30以后允许发起抽签,抽签结果确定后不可更改

第一名与第二名得票数相差不超过10%时随机抽签,按其得票数决定中签概率,否则选择第一名

{% for last_result in last_results %} -

今日{{ last_result }}最终得票数降低{{ 1 + loop.index0 }}0%

+

今日{{ last_result }}最终得票数降低{{ 2 + loop.index0 }}0%

{% endfor %}