更新排序

This commit is contained in:
ACT丶流星雨 2026-03-31 03:58:17 +08:00
parent cfdb3131d1
commit ff9809f78e

View File

@ -21,7 +21,7 @@ export default router.post(
.andWhere("o_assets.type", "<>", "clip") .andWhere("o_assets.type", "<>", "clip")
.modify((qb) => { .modify((qb) => {
if (type && type.length > 0) qb.whereIn("o_assets.type", type); 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( const result = await Promise.all(
data.map(async (parent: any) => { data.map(async (parent: any) => {
const historyImages = await u.db("o_image").where("assetsId", parent.id).andWhere("state", "已完成").select("id", "filePath"); const historyImages = await u.db("o_image").where("assetsId", parent.id).andWhere("state", "已完成").select("id", "filePath");