diff --git a/core/data/alembic/versions/49c295e89cd4_chunithm_verse.py b/core/data/alembic/versions/49c295e89cd4_chunithm_verse.py index 61b813f..d52e445 100644 --- a/core/data/alembic/versions/49c295e89cd4_chunithm_verse.py +++ b/core/data/alembic/versions/49c295e89cd4_chunithm_verse.py @@ -44,7 +44,7 @@ def upgrade(): mysql_charset="utf8mb4", ) - op.create_tablee( + op.create_table( "chuni_item_unlock_challenge", sa.Column("id", sa.Integer(), primary_key=True, nullable=False), sa.Column("version", sa.Integer(), nullable=False), @@ -59,7 +59,7 @@ def upgrade(): sa.Column("conditionType", sa.Integer()), sa.Column("score", sa.Integer()), sa.Column("life", sa.Integer()), - sa.Column("clearDate", sa.Integer()), + sa.Column("clearDate", sa.TIMESTAMP(), server_defaul=func.now()), sa.UniqueConstraint( "version", "user", diff --git a/titles/chuni/frontend.py b/titles/chuni/frontend.py index 1059d7c..e860400 100644 --- a/titles/chuni/frontend.py +++ b/titles/chuni/frontend.py @@ -655,14 +655,18 @@ class ChuniFrontend(FE_Base): form_data = await request.form() new_nameplate: str = form_data.get("nameplate") new_trophy: str = form_data.get("trophy") + new_trophy_sub_1: str = form_data.get("trophySub1") + new_trophy_sub_2: str = form_data.get("trophySub2") new_character: str = form_data.get("character") if not new_nameplate or \ not new_trophy or \ + not new_trophy_sub_1 or \ + not new_trophy_sub_2 or \ not new_character: return RedirectResponse("/game/chuni/userbox?e=4", 303) - if not await self.data.profile.update_userbox(usr_sesh.user_id, usr_sesh.chunithm_version, new_nameplate, new_trophy, new_character): + if not await self.data.profile.update_userbox(usr_sesh.user_id, usr_sesh.chunithm_version, new_nameplate, new_trophy, new_trophy_sub_1, new_trophy_sub_2, new_character): return RedirectResponse("/gate/?e=999", 303) return RedirectResponse("/game/chuni/userbox", 303) diff --git a/titles/chuni/schema/item.py b/titles/chuni/schema/item.py index 84c6364..90b993f 100644 --- a/titles/chuni/schema/item.py +++ b/titles/chuni/schema/item.py @@ -293,7 +293,7 @@ unlock_challenge = Table( Column("conditionType", Integer), Column("score", Integer), Column("life", Integer), - Column("clearDate", TIMESTAMP), + Column("clearDate", TIMESTAMP, server_default=func.now()), UniqueConstraint( "version", "user", "unlockChallengeId", name="chuni_item_unlock_challenge_uk" ), diff --git a/titles/chuni/schema/profile.py b/titles/chuni/schema/profile.py index 5f54f5e..c642514 100644 --- a/titles/chuni/schema/profile.py +++ b/titles/chuni/schema/profile.py @@ -463,12 +463,12 @@ class ChuniProfileData(BaseData): return False return True - async def update_userbox(self, user_id: int, version: int, new_nameplate: int, new_trophy: int, new_character: int) -> bool: + async def update_userbox(self, user_id: int, version: int, new_nameplate: int, new_trophy: int, new_trophy_sub_1: int, new_trophy_sub_2: int, new_character: int) -> bool: sql = profile.update((profile.c.user == user_id) & (profile.c.version == version)).values( nameplateId=new_nameplate, trophyId=new_trophy, - trophyIdSub1=new_trophySub1, - trophyIdSub2=new_trophySub2, + trophyIdSub1=new_trophy_sub_1, + trophyIdSub2=new_trophy_sub_2, charaIllustId=new_character ) result = await self.execute(sql) diff --git a/titles/chuni/templates/chuni_userbox.jinja b/titles/chuni/templates/chuni_userbox.jinja index 5114b17..3bca2fd 100644 --- a/titles/chuni/templates/chuni_userbox.jinja +++ b/titles/chuni/templates/chuni_userbox.jinja @@ -44,7 +44,25 @@ Nameplate:
Trophy:
- + {% for item in trophies.values() %} + + {% endfor %} + +
+ + Trophy Sub 1:
+ +
+ + Trophy Sub 2:
+