Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
themrrobert committed Jun 13, 2024
1 parent b720e32 commit 9329796
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export async function analyticsTick() {
const [totalGeGp, totalArtifactGp, totalDemonStatuetteGp] = (
await Promise.all(
[
'SELECT quantity AS ge_gp FROM ge_bank WHERE item_id = 995',
`SELECT SUM((bank->>'${artifact.id})::bigint) * ${artifact.highalch} as artifact_val`,
`SELECT SUM((bank->>'${statuette.id})::bigint) * ${statuette.highalch} as statuette_val`
].map(q => prisma.$queryRawUnsafe<string>(q))
'SELECT quantity AS val FROM ge_bank WHERE item_id = 995',
`SELECT COALESCE(SUM((bank->>'${artifact.id}')::bigint) * ${artifact.highalch}, 0) as val FROM users WHERE bank->>'${artifact.id}' IS NOT NULL`,
`SELECT COALESCE(SUM((bank->>'${statuette.id}')::bigint) * ${statuette.highalch}, 0) as val FROM users WHERE bank->>'${artifact.id}' IS NOT NULL`
].map(q => prisma.$queryRawUnsafe<{ val: bigint }[]>(q))
)
).map((v: string) => BigInt(v));
).map((v: { val: bigint }[]) => BigInt(v[0].val));

const taskCounts = await calculateMinionTaskCounts();
const currentClientSettings = await prisma.clientStorage.findFirst({
Expand Down

0 comments on commit 9329796

Please sign in to comment.