|
@@ -30,7 +30,7 @@ func (dao *OrderGoodDao) CooperationGoodsStatistics(queryOptions map[string]inte |
|
@@ -30,7 +30,7 @@ func (dao *OrderGoodDao) CooperationGoodsStatistics(queryOptions map[string]inte |
30
|
queryLimit = fmt.Sprintf("limit %v", queryOptions["limit"])
|
30
|
queryLimit = fmt.Sprintf("limit %v", queryOptions["limit"])
|
31
|
}
|
31
|
}
|
32
|
sql := fmt.Sprintf(`select order_good_name good_name,sum(order_good_amount) good_amount from order_goods
|
32
|
sql := fmt.Sprintf(`select order_good_name good_name,sum(order_good_amount) good_amount from order_goods
|
33
|
-where company_id=? and org_id = ? %v
|
33
|
+where company_id=? and org_id = ? and deleted_at is null %v
|
34
|
GROUP BY order_good_name
|
34
|
GROUP BY order_good_name
|
35
|
order by good_amount desc
|
35
|
order by good_amount desc
|
36
|
%v
|
36
|
%v
|
|
@@ -49,7 +49,7 @@ func (dao *OrderGoodDao) CooperationCompanyModeStatistics(queryOptions map[strin |
|
@@ -49,7 +49,7 @@ func (dao *OrderGoodDao) CooperationCompanyModeStatistics(queryOptions map[strin |
49
|
var goods []*domain.CooperationModeStatisticsDto
|
49
|
var goods []*domain.CooperationModeStatisticsDto
|
50
|
sql := fmt.Sprintf(`select count(0) cooperation_people,sum(a.actually_paid_amount) dividends_estimate,b.cooperation_mode_number,sum(good_amount_count) order_amount
|
50
|
sql := fmt.Sprintf(`select count(0) cooperation_people,sum(a.actually_paid_amount) dividends_estimate,b.cooperation_mode_number,sum(good_amount_count) order_amount
|
51
|
from credit_accounts a inner join cooperation_contracts b on a.cooperation_contract_number = b.cooperation_contract_number
|
51
|
from credit_accounts a inner join cooperation_contracts b on a.cooperation_contract_number = b.cooperation_contract_number
|
52
|
-where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and b.status = 1
|
52
|
+where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and a.deleted_at is null and b.status = 1
|
53
|
group by b.cooperation_mode_number
|
53
|
group by b.cooperation_mode_number
|
54
|
`)
|
54
|
`)
|
55
|
_, err := tx.Query(&goods, sql, queryOptions["companyId"], queryOptions["orgId"])
|
55
|
_, err := tx.Query(&goods, sql, queryOptions["companyId"], queryOptions["orgId"])
|