...
|
...
|
@@ -30,7 +30,7 @@ func (dao *OrderGoodDao) CooperationGoodsStatistics(queryOptions map[string]inte |
|
|
queryLimit = fmt.Sprintf("limit %v", queryOptions["limit"])
|
|
|
}
|
|
|
sql := fmt.Sprintf(`select order_good_name good_name,sum(order_good_amount) good_amount from order_goods
|
|
|
where company_id=? and org_id = ? %v
|
|
|
where company_id=? and org_id = ? and deleted_at is null %v
|
|
|
GROUP BY order_good_name
|
|
|
order by good_amount desc
|
|
|
%v
|
...
|
...
|
@@ -49,7 +49,7 @@ func (dao *OrderGoodDao) CooperationCompanyModeStatistics(queryOptions map[strin |
|
|
var goods []*domain.CooperationModeStatisticsDto
|
|
|
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
|
|
|
from credit_accounts a inner join cooperation_contracts b on a.cooperation_contract_number = b.cooperation_contract_number
|
|
|
where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and b.status = 1
|
|
|
where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and a.deleted_at is null and b.status = 1
|
|
|
group by b.cooperation_mode_number
|
|
|
`)
|
|
|
_, err := tx.Query(&goods, sql, queryOptions["companyId"], queryOptions["orgId"])
|
...
|
...
|
|