diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCashierCartMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCashierCartMapper.java index 68b0f273..d43bb77a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCashierCartMapper.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCashierCartMapper.java @@ -20,9 +20,9 @@ public interface TbCashierCartMapper extends BaseMapper { " from tb_cashier_cart where table_id is not null and shop_id = #{shopId} and status = 'refund' group by shop_Id, master_id order by trade_day desc") List selectCar(@Param("shopId") Integer shopId); - @Select(" SELECT order_id orderId, pending_at, sum(total_amount) totalAmount, count(id) totalCount, count(total_number) totalNumber from tb_cashier_cart where status = 'refund' and shop_id=#{shopId} " + + @Select(" SELECT order_id orderId, pending_at, sum(total_amount) totalAmount, count(id) totalCount, count(total_number) totalNumber from tb_cashier_cart where status = 'refund' and shop_id=#{shopId} and table_id=#{tableId} " + " GROUP BY order_id ORDER BY trade_day") - List countPending(@Param("shopId") Integer shopId); + List countPending(@Param("shopId") Integer shopId, @Param("tableId") String tableId); @Select("select a.*, b.spec_snap from tb_cashier_cart as a left join tb_product_sku as b on a.sku_id=b.id where a.shop_id=#{shopId} and a.status='refund';") List selectPending(Integer shopId); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java index abcce67a..a2d4dc79 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java @@ -993,7 +993,7 @@ public class TbShopTableServiceImpl implements TbShopTableService { public Object getCar(Integer shopId, String tableId) { ArrayList> data = new ArrayList<>(); - List pendingCountVOS = cashierCartMapper.countPending(shopId); + List pendingCountVOS = cashierCartMapper.countPending(shopId, tableId); List tbCashierCarts = cashierCartMapper.selectList(new LambdaQueryWrapper() .eq(TbCashierCart::getShopId, shopId) .eq(TbCashierCart::getTableId, tableId)