chuni: fix lost scores for real
This commit is contained in:
@@ -23,7 +23,7 @@ export default async function getGameSetting(
|
|||||||
isBackgroundDistribute: "false",
|
isBackgroundDistribute: "false",
|
||||||
maxCountCharacter: "300",
|
maxCountCharacter: "300",
|
||||||
maxCountItem: "300",
|
maxCountItem: "300",
|
||||||
maxCountMusic: "300",
|
maxCountMusic: "100",
|
||||||
},
|
},
|
||||||
isDumpUpload: "false",
|
isDumpUpload: "false",
|
||||||
isAou: "false",
|
isAou: "false",
|
||||||
|
|||||||
@@ -34,14 +34,22 @@ export class SqlUserMusicRepository implements UserMusicRepository {
|
|||||||
profileId: Id<UserDataItem>,
|
profileId: Id<UserDataItem>,
|
||||||
page?: Page
|
page?: Page
|
||||||
): Promise<UserMusicDetailItem[]> {
|
): Promise<UserMusicDetailItem[]> {
|
||||||
|
const preStmt = sql
|
||||||
|
.select("DISTINCT(music_id)")
|
||||||
|
.from("cm_user_music")
|
||||||
|
.where("profile_id", profileId)
|
||||||
|
.orderBy("music_id");
|
||||||
|
if (page) {
|
||||||
|
preStmt.limit(page.limit).offset(page.offset);
|
||||||
|
}
|
||||||
|
const preRows = await this._txn.fetchRows(preStmt);
|
||||||
|
const musicIds = preRows.map(r => r.music_id);
|
||||||
|
|
||||||
const stmt = sql
|
const stmt = sql
|
||||||
.select("*")
|
.select("*")
|
||||||
.from("cm_user_music")
|
.from("cm_user_music")
|
||||||
.where("profile_id", profileId);
|
.where("profile_id", profileId)
|
||||||
|
.and(sql.in('music_id', musicIds));
|
||||||
if (page) {
|
|
||||||
stmt.limit(page.limit).offset(page.offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
const rows = await this._txn.fetchRows(stmt);
|
const rows = await this._txn.fetchRows(stmt);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user