perf: 倒序

This commit is contained in:
archer
2023-04-18 23:51:30 +08:00
parent 9e951fbc15
commit 629a147741
2 changed files with 2 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
const searchRes = await pg.query<PgModelDataItemType>(`SELECT id, q, a, status
FROM modelData
WHERE user_id='${userId}' AND model_id='${modelId}'
ORDER BY id DESC
LIMIT ${pageSize} OFFSET ${pageSize * (pageNum - 1)}
`);