正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
@@ -32,7 +32,7 @@ func (dao *OrderGoodDao) CooperationGoodsStatistics(queryOptions map[string]inte | @@ -32,7 +32,7 @@ func (dao *OrderGoodDao) CooperationGoodsStatistics(queryOptions map[string]inte | ||
32 | if v, ok := queryOptions["limit"]; ok { | 32 | if v, ok := queryOptions["limit"]; ok { |
33 | queryLimit += fmt.Sprintf("limit %v \n", v) | 33 | queryLimit += fmt.Sprintf("limit %v \n", v) |
34 | } | 34 | } |
35 | - sql := fmt.Sprintf(`select order_good_name good_name,sum(coalesce(order_good_amount,0)) good_amount from order_goods | 35 | + sql := fmt.Sprintf(`select order_good_name good_name,sum(coalesce(case when dividends_order_number is not null then order_good_amount else -order_good_amount end,0)) good_amount from order_goods |
36 | where company_id=? and org_id = ? and deleted_at is null %v | 36 | where company_id=? and org_id = ? and deleted_at is null %v |
37 | GROUP BY order_good_name | 37 | GROUP BY order_good_name |
38 | order by good_amount desc | 38 | order by good_amount desc |
-
请 注册 或 登录 后发表评论