mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-18 04:23:21 +08:00
🏷️ 添加blings
This commit is contained in:
@@ -28,6 +28,7 @@ function transUserChallenge(
|
||||
name: data.schedule.name,
|
||||
single: data.single,
|
||||
mp: data.mp,
|
||||
blings: data.blings,
|
||||
updated: timestampToDate(new Date().getTime()),
|
||||
};
|
||||
}
|
||||
@@ -42,15 +43,17 @@ function transUserChallenge(
|
||||
function getInsertSql(data: TGApp.Sqlite.Challenge.SingleTable, uid?: string): string {
|
||||
const timeNow = timestampToDate(new Date().getTime());
|
||||
return `
|
||||
INSERT INTO HardChallenge(uid, id, startTime, endTime, name, single, mp, updated)
|
||||
INSERT INTO HardChallenge(uid, id, startTime, endTime, name, single, mp, blings, updated)
|
||||
VALUES ('${uid ?? data.uid}', ${data.id}, '${data.startTime}', '${data.endTime}', '${data.name}',
|
||||
'${JSON.stringify(data.single)}', '${JSON.stringify(data.mp)}', '${timeNow}') ON CONFLICT(uid,id) DO
|
||||
UPDATE
|
||||
'${JSON.stringify(data.single)}', '${JSON.stringify(data.mp)}', '${JSON.stringify(data.blings)}',
|
||||
'${timeNow}')
|
||||
ON CONFLICT(uid,id) DO UPDATE
|
||||
SET startTime = '${data.startTime}',
|
||||
endTime = '${data.endTime}',
|
||||
name = '${data.name}',
|
||||
single = '${JSON.stringify(data.single)}',
|
||||
mp = '${JSON.stringify(data.mp)}',
|
||||
blings = '${JSON.stringify(data.blings)}',
|
||||
updated = '${timeNow}'
|
||||
`;
|
||||
}
|
||||
@@ -98,6 +101,7 @@ async function getChallenge(uid?: string): Promise<Array<TGApp.Sqlite.Challenge.
|
||||
name: raw.name,
|
||||
single: JSON.parse(raw.single),
|
||||
mp: JSON.parse(raw.mp),
|
||||
blings: JSON.parse(raw.blings),
|
||||
updated: raw.updated,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ async function getCombat(uid?: string): Promise<TGApp.Sqlite.Combat.SingleTable[
|
||||
);
|
||||
} else {
|
||||
resR = await db.select<Array<TGApp.Sqlite.Combat.RawTable>>(
|
||||
"SELECT * FROM RoleCombat WHERE uid = ?;",
|
||||
"SELECT * FROM RoleCombat WHERE uid = ? ORDER BY id DESC;",
|
||||
[uid],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ create table if not exists HardChallenge
|
||||
name text,
|
||||
single text,
|
||||
mp text,
|
||||
blings text,
|
||||
updated text,
|
||||
primary key (uid, id)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user