【修复】商城系统:管理后台的商城订单统计数据有问题

This commit is contained in:
YunaiV 2024-05-02 09:25:03 +08:00
parent f9a50116bc
commit 3f7e99c938
3 changed files with 7 additions and 7 deletions

View File

@ -58,8 +58,8 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX<TradeStatisticsD
Long selectCountByStatusAndDeliveryType(@Param("status") Integer status, @Param("deliveryType") Integer deliveryType);
TradeOrderSummaryRespVO selectPaySummaryByStatusAndPayTimeBetween(@Param("status") Integer status,
@Param("beginTime") LocalDateTime beginTime,
@Param("endTime") LocalDateTime endTime);
TradeOrderSummaryRespVO selectPaySummaryByPayStatusAndPayTimeBetween(@Param("payStatus") Integer payStatus,
@Param("beginTime") LocalDateTime beginTime,
@Param("endTime") LocalDateTime endTime);
}

View File

@ -75,8 +75,8 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ
private TradeOrderSummaryRespVO getPayPriceSummary(LocalDateTime date) {
LocalDateTime beginTime = LocalDateTimeUtil.beginOfDay(date);
LocalDateTime endTime = LocalDateTimeUtil.beginOfDay(date);
return tradeOrderStatisticsMapper.selectPaySummaryByStatusAndPayTimeBetween(
LocalDateTime endTime = LocalDateTimeUtil.endOfDay(date);
return tradeOrderStatisticsMapper.selectPaySummaryByPayStatusAndPayTimeBetween(
PayOrderStatusEnum.SUCCESS.getStatus(), beginTime, endTime);
}

View File

@ -93,12 +93,12 @@
AND deleted = FALSE
</select>
<select id="selectPaySummaryByStatusAndPayTimeBetween"
<select id="selectPaySummaryByPayStatusAndPayTimeBetween"
resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeOrderSummaryRespVO">
SELECT IFNULL(SUM(pay_price), 0) AS orderPayPrice,
COUNT(1) AS orderPayCount
FROM trade_order
WHERE status = #{status}
WHERE pay_status = #{payStatus}
AND pay_time BETWEEN #{beginTime} AND #{endTime}
AND deleted = FALSE
</select>