chore: formatting
This commit is contained in:
parent
08dd7793bc
commit
cc465530b5
36
index.ts
36
index.ts
@ -19,13 +19,13 @@ interface ArtemisPlaylog extends RowDataPacket {
|
||||
|
||||
const fetchArtemis = async (conn: mysql.Connection, userId: number) => {
|
||||
const [ bestScores ] = await conn.query<ArtemisBest[]>(
|
||||
'select \
|
||||
musicId, \
|
||||
level, \
|
||||
clearStatus \
|
||||
from ongeki_score_best \
|
||||
where user=? \
|
||||
', [userId]
|
||||
`select
|
||||
musicId,
|
||||
level,
|
||||
clearStatus
|
||||
from ongeki_score_best
|
||||
where user=?`,
|
||||
[userId]
|
||||
);
|
||||
|
||||
let n = 0;
|
||||
@ -34,21 +34,22 @@ const fetchArtemis = async (conn: mysql.Connection, userId: number) => {
|
||||
continue;
|
||||
}
|
||||
const [ playlogs ] = await conn.query<ArtemisPlaylog[]>(
|
||||
`select \
|
||||
clearStatus \
|
||||
from ongeki_score_playlog \
|
||||
`select
|
||||
clearStatus
|
||||
from ongeki_score_playlog
|
||||
where user=? and musicId=? and level=?
|
||||
order by clearStatus desc
|
||||
limit 1
|
||||
`, [userId, best.musicId, best.level]
|
||||
limit 1`,
|
||||
[userId, best.musicId, best.level]
|
||||
);
|
||||
|
||||
if(playlogs.length > 0 && playlogs[0].clearStatus === 2) {
|
||||
await conn.query(
|
||||
`update ongeki_score_best \
|
||||
`update ongeki_score_best
|
||||
set clearStatus=1
|
||||
where user=? and musicId=? and level=?`
|
||||
, [userId, best.musicId, best.level]);
|
||||
where user=? and musicId=? and level=?`,
|
||||
[userId, best.musicId, best.level]
|
||||
);
|
||||
n += 1;
|
||||
}
|
||||
}
|
||||
@ -81,7 +82,10 @@ const main = async () => {
|
||||
charset: 'utf8mb4'
|
||||
});
|
||||
|
||||
const [ profiles ] = await conn.query<ArtemisProfile[]>('select user from ongeki_profile_data');
|
||||
const [ profiles ] = await conn.query<ArtemisProfile[]>(
|
||||
`select user
|
||||
from ongeki_profile_data`
|
||||
);
|
||||
|
||||
for(const profile of profiles) {
|
||||
await fetchArtemis(conn, profile.user);
|
||||
|
Loading…
Reference in New Issue
Block a user