fix the logic

This commit is contained in:
UncleJim 2023-11-19 11:54:04 +00:00
parent 9605c13e8e
commit 25ab37561d
1 changed files with 16 additions and 12 deletions

View File

@ -2388,16 +2388,18 @@ class IDACSeason2(IDACBase):
vs_info["lose_now"] += 1 if data.get("win_flg") == 0 else 0
vs_info["break_count"] += data.get("break_count")
vs_info["break_penalty_flag"] = data.get("break_penalty_flag")
course_exists = 0
for course in vs_info["vsinfo_course_data"]:
if course["course_id"] == data.get("course_id"):
course["vs_cnt"] += 1
course["vs_win"] += data.get("win_flg")
else:
course = {}
course["course_id"] = data.get("course_id")
course["vs_cnt"] = 1
course["vs_win"] = data.get("win_flg")
vs_info["vsinfo_course_data"].append(course)
course_exists = 1
if course_exists == 0:
course = {}
course["course_id"] = data.get("course_id")
course["vs_cnt"] = 1
course["vs_win"] = data.get("win_flg")
vs_info["vsinfo_course_data"].append(course)
self.data.item.put_vs_info(user_id, 0, vs_info)
else:
vs_info = {
@ -2509,16 +2511,18 @@ class IDACSeason2(IDACBase):
vs_info["lose_now"] += 1 if data.get("win_flg") == 0 else 0
vs_info["break_count"] += data.get("break_count")
vs_info["break_penalty_flag"] = data.get("break_penalty_flag")
course_exists = 0
for course in vs_info["vsinfo_course_data"]:
if course["course_id"] == data.get("course_id"):
course["vs_cnt"] += 1
course["vs_win"] += data.get("win_flg")
else:
course = {}
course["course_id"] = data.get("course_id")
course["vs_cnt"] = 1
course["vs_win"] = data.get("win_flg")
vs_info["vsinfo_course_data"].append(course)
course_exists = 1
if course_exists == 0:
course = {}
course["course_id"] = data.get("course_id")
course["vs_cnt"] = 1
course["vs_win"] = data.get("win_flg")
vs_info["vsinfo_course_data"].append(course)
self.data.item.put_vs_info(user_id, 1, vs_info)
else:
vs_info = {