refactor(data-report): 优化财务成本分项SQL查询逻辑
- 实现两层GROUP BY结构避免JOIN笛卡尔乘积导致的数据重复计算 - 内层按merchant_name + order_code分组处理子订单级和订单级字段聚合 - 外层按merchant_name分组进行跨订单数据汇总 - 统一产品成本口径为upgrade_shop_price - base_shop_price计算方式 - 优化字段别名定义提升查询可读性 - 更新注释说明关键实现逻辑和业务规则变化
Showing
2 changed files
with
104 additions
and
61 deletions
-
Please register or sign in to post a comment