mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-04-19 06:00:18 +00:00
fix(models): null value checking
This commit is contained in:
parent
c7de60ee03
commit
62c85e9e82
@ -1,6 +1,6 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from sqlalchemy import TEXT, case, func, inspect, select
|
from sqlalchemy import TEXT, case, func, inspect, select, text
|
||||||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
||||||
from sqlalchemy_utils import create_view
|
from sqlalchemy_utils import create_view
|
||||||
|
|
||||||
@ -78,10 +78,16 @@ class ScoreCalculated(ScoresViewBase):
|
|||||||
Score.score,
|
Score.score,
|
||||||
Score.pure,
|
Score.pure,
|
||||||
(
|
(
|
||||||
|
case(
|
||||||
|
(
|
||||||
|
(ChartInfo.notes.isnot(None) & ChartInfo.notes != 0),
|
||||||
Score.score
|
Score.score
|
||||||
- func.floor(
|
- func.floor(
|
||||||
(Score.pure * 10000000.0 / ChartInfo.notes)
|
(Score.pure * 10000000.0 / ChartInfo.notes)
|
||||||
+ (Score.far * 0.5 * 10000000.0 / ChartInfo.notes)
|
+ (Score.far * 0.5 * 10000000.0 / ChartInfo.notes)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
else_=text("NULL"),
|
||||||
)
|
)
|
||||||
).label("shiny_pure"),
|
).label("shiny_pure"),
|
||||||
Score.far,
|
Score.far,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user