待起菜数量

This commit is contained in:
2025-12-01 15:34:42 +08:00
parent 2c9158c7ba
commit b224bed440

View File

@@ -52,7 +52,7 @@
COALESCE(`table`.`name`, '无台桌') AS tableName,
`table`.`area_id` AS areaId,
CASE WHEN `table`.id IS NULL THEN '吧台' ELSE COALESCE(`area`.`name`, '') END AS areaName,
count( detail.id ) AS pendingDishCount
sum(case when detail.sub_status = 'READY_TO_SERVE' then detail.num - detail.return_num else 0 end) AS pendingDishCount
FROM
`tb_order_detail` detail
INNER JOIN `tb_order_info` `order` ON detail.order_id = `order`.id AND `order`.`status` = 'unpaid'