mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-11 02:17:28 +08:00
Fix a bug about course system
- Fix a bug that the hidden courses cannot appear even if their requirements are satisfied
This commit is contained in:
@@ -213,7 +213,18 @@ class UserCourseList:
|
|||||||
self.courses: list = []
|
self.courses: list = []
|
||||||
|
|
||||||
def to_dict_list(self) -> list:
|
def to_dict_list(self) -> list:
|
||||||
return [x.to_dict() for x in self.courses]
|
# 临时修复满足条件也无法解锁隐藏段位的问题
|
||||||
|
completed_course_id_list: list = []
|
||||||
|
r: list = []
|
||||||
|
for x in self.courses:
|
||||||
|
if x.is_completed:
|
||||||
|
completed_course_id_list.append(x.course_id)
|
||||||
|
r.append(x.to_dict())
|
||||||
|
for x in r:
|
||||||
|
for i in x['requirements']:
|
||||||
|
if i['value'] in completed_course_id_list:
|
||||||
|
i['is_fullfilled'] = True
|
||||||
|
return r
|
||||||
|
|
||||||
def select_all(self) -> None:
|
def select_all(self) -> None:
|
||||||
self.c.execute('''select * from course''')
|
self.c.execute('''select * from course''')
|
||||||
|
|||||||
Reference in New Issue
Block a user