diff --git a/src/routes/cornerScape/getAllAssets.ts b/src/routes/cornerScape/getAllAssets.ts index 0977f2e..ef4ce0a 100644 --- a/src/routes/cornerScape/getAllAssets.ts +++ b/src/routes/cornerScape/getAllAssets.ts @@ -21,7 +21,7 @@ export default router.post( .andWhere("o_assets.type", "<>", "clip") .modify((qb) => { if (type && type.length > 0) qb.whereIn("o_assets.type", type); - }); + }).orderByRaw(`CASE o_assets.type WHEN 'role' THEN 1 WHEN 'scene' THEN 2 WHEN 'tool' THEN 3 ELSE 4 END`); const result = await Promise.all( data.map(async (parent: any) => { const historyImages = await u.db("o_image").where("assetsId", parent.id).andWhere("state", "已完成").select("id", "filePath");