作者 yangfu

分红预算修改

@@ -147,7 +147,7 @@ func (dao *DividendsEstimateDao) CountDividendsEstimateDividendsAmount(queryOpti @@ -147,7 +147,7 @@ func (dao *DividendsEstimateDao) CountDividendsEstimateDividendsAmount(queryOpti
147 query.Where("cooperation_contract_number in (?)", pg.In(cooperationContractNumbers)) 147 query.Where("cooperation_contract_number in (?)", pg.In(cooperationContractNumbers))
148 } 148 }
149 query.AllWithDeleted() 149 query.AllWithDeleted()
150 - query.Where("is_canceled is null") 150 + query.Where("is_canceled = false")
151 var dividendsAmount float64 151 var dividendsAmount float64
152 if err := query.Select(&dividendsAmount); err != nil { 152 if err := query.Select(&dividendsAmount); err != nil {
153 return 0, err 153 return 0, err
@@ -57,7 +57,7 @@ func (dao *OrderGoodDao) CooperationCompanyModeStatistics(queryOptions map[strin @@ -57,7 +57,7 @@ func (dao *OrderGoodDao) CooperationCompanyModeStatistics(queryOptions map[strin
57 //`) 57 //`)
58 sql := fmt.Sprintf(`select count(DISTINCT dividends_user->>'userId') cooperation_people,sum(a.dividends_amount) dividends_estimate,b.cooperation_mode_number 58 sql := fmt.Sprintf(`select count(DISTINCT dividends_user->>'userId') cooperation_people,sum(a.dividends_amount) dividends_estimate,b.cooperation_mode_number
59 from dividends_estimates a inner join cooperation_contracts b on a.cooperation_contract_number = b.cooperation_contract_number 59 from dividends_estimates a inner join cooperation_contracts b on a.cooperation_contract_number = b.cooperation_contract_number
60 -where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and a.is_canceled is null and a.deleted_at is null and b.status = 1 60 +where a.company->>'companyId' = '?' and a.org->>'orgId' = '?' and a.is_canceled = false and a.deleted_at is null and b.status = 1
61 group by b.cooperation_mode_number 61 group by b.cooperation_mode_number
62 `) 62 `)
63 _, err := tx.Query(&goods, sql, queryOptions["companyId"], queryOptions["orgId"]) 63 _, err := tx.Query(&goods, sql, queryOptions["companyId"], queryOptions["orgId"])
@@ -84,7 +84,7 @@ func (dao *OrderGoodDao) CooperationUserModeStatistics(queryOptions map[string]i @@ -84,7 +84,7 @@ func (dao *OrderGoodDao) CooperationUserModeStatistics(queryOptions map[string]i
84 query.Where(fmt.Sprintf(` "dividends_estimate".org->>'orgId'= '%v'`, v)) 84 query.Where(fmt.Sprintf(` "dividends_estimate".org->>'orgId'= '%v'`, v))
85 query.Where(fmt.Sprintf(` a.org->>'orgId'= '%v'`, v)) 85 query.Where(fmt.Sprintf(` a.org->>'orgId'= '%v'`, v))
86 } 86 }
87 - query.Where("dividends_estimate.is_canceled is null") 87 + query.Where("dividends_estimate.is_canceled = false")
88 query.Where("dividends_estimate.deleted_at is null") 88 query.Where("dividends_estimate.deleted_at is null")
89 query.Group("cooperation_mode_number") 89 query.Group("cooperation_mode_number")
90 err := query.Select(&goods) 90 err := query.Select(&goods)