cloudroam
2025-03-29 5997dc8acfa81a6c867c28810d1c3c9714efc46c
src/main/java/com/mzl/flower/service/flower/FlowerService.java
@@ -479,6 +479,13 @@
        if(flower == null){
            throw new ValidationException("商品未找到");
        }
        if (flower.getStatus().equals(Constants.FLOWER_STATUS.UP.name())) {
            throw new ValidationException("上架商品无法删除");
        }
        if (flower.getStatus().equals(Constants.FLOWER_STATUS.PENDING.name())) {
            throw new ValidationException("待审核商品无法删除");
        }
        flowerMapper.deleteById(id);
@@ -693,9 +700,10 @@
    public Page<FlowerShowListDTO> myCollect(Page page, FlowerShowQueryDTO dto) {
        dto.setUserId(SecurityUtils.getUserId());
        if (StringUtils.isNotEmpty(dto.getColumn())) {
            if(dto.getColumn().contains("sales")
                    || dto.getColumn().contains("stock")){
            if(dto.getColumn().contains("stock")){
                dto.setColumn(dto.getColumn() + " desc");
            } else if (dto.getColumn().contains("sales")) {
                dto.setColumn("ifnull(sales, 0) + ifnull(real_sales, 0) desc");
            }
        }
@@ -723,9 +731,9 @@
                s.setCollection(s.getCollectCount() > 0);
                s.setShopnum(s.getShopnum() == null ? 0 : s.getShopnum());
                if(s.getSales() != null && s.getRealSales() != null){
                /*if(s.getSales() != null && s.getRealSales() != null){
                    s.setSales(s.getSales() + s.getRealSales());
                }
                }*/
            }
        }
    }