1.修复历史查询汇总返回总数不准确的问题;

This commit is contained in:
chenlin 2024-10-24 09:52:51 +08:00
parent ff4b3a7b54
commit dde900dfe5

View File

@ -404,9 +404,7 @@ func (e MiGuDeployService) HistoricalSummaryList(c *gin.Context) {
NULLIF(COUNT(*), 0), 2), '%') AS new_user_unsub_on_day_rate`).
Where("mg_order.subscribe_time >= ? AND mg_order.subscribe_time <= ?", startTime, endTime).
Group("DATE(mg_order.subscribe_time), mg_order.product_id, mg_order.channel_code").
Order("mg_order.product_id, mg_order.channel_code, mg_order.subscribe_time").
Offset(pageNum * req.PageSize).
Limit(req.PageSize)
Order("mg_order.product_id, mg_order.channel_code, mg_order.subscribe_time")
// 添加过滤条件
if req.SkuCode != 0 {
@ -425,7 +423,7 @@ func (e MiGuDeployService) HistoricalSummaryList(c *gin.Context) {
}
// 执行查询
err = qs.Find(&historicalSummaryList).Error
err = qs.Offset(pageNum * req.PageSize).Limit(req.PageSize).Find(&historicalSummaryList).Error
if err != nil {
logger.Errorf("HistoricalSummaryList query err: %#v", err)
response.Error(c, http.StatusInternalServerError, err, "查询失败")