...
|
...
|
@@ -57,7 +57,7 @@ func (dao *OrderGoodDao) CooperationCompanyModeStatistics(queryOptions map[strin |
|
|
//`)
|
|
|
sql := fmt.Sprintf(`select count(DISTINCT dividends_user->>'userId') cooperation_people,sum(a.dividends_amount) dividends_estimate,b.cooperation_mode_number
|
|
|
from dividends_estimates a inner join cooperation_contracts b on a.cooperation_contract_number = b.cooperation_contract_number
|
|
|
where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and a.is_canceled is null and a.deleted_at is null and b.status = 1
|
|
|
where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and a.is_canceled = false 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"])
|
...
|
...
|
@@ -84,7 +84,7 @@ func (dao *OrderGoodDao) CooperationUserModeStatistics(queryOptions map[string]i |
|
|
query.Where(fmt.Sprintf(` "dividends_estimate".org->>'orgId'= '%v'`, v))
|
|
|
query.Where(fmt.Sprintf(` a.org->>'orgId'= '%v'`, v))
|
|
|
}
|
|
|
query.Where("dividends_estimate.is_canceled is null")
|
|
|
query.Where("dividends_estimate.is_canceled = false")
|
|
|
query.Where("dividends_estimate.deleted_at is null")
|
|
|
query.Group("cooperation_mode_number")
|
|
|
err := query.Select(&goods)
|
...
|
...
|
|