ORDER BY sale_end_date ASC NULLS LAST, item_name ASC. 마감일이 가까운 품목이 먼저, 같은 마감 안에서는 이름순, 상시 판매는 맨 뒤.
This commit is contained in:
@@ -164,7 +164,8 @@ export async function POST(req: NextRequest) {
|
||||
LEFT JOIN momo_makers M ON I.maker_objid = M.objid
|
||||
LEFT JOIN supply_mng V ON I.vendor_objid = V.objid::text
|
||||
WHERE ${conditions.join(" AND ")}
|
||||
ORDER BY I.item_name ASC
|
||||
-- 마감시간 임박 순(빠른 것 먼저) → 같은 마감 안에서는 가나다 순. 상시(NULL)는 맨 뒤.
|
||||
ORDER BY I.sale_end_date ASC NULLS LAST, I.item_name ASC
|
||||
`;
|
||||
|
||||
const rows = await queryRows(sql, params);
|
||||
|
||||
Reference in New Issue
Block a user