作者 陈志颖

fix:兑换素币清单展示已离职人员

... ... @@ -63,7 +63,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac
queryPeople = queryPeople.ColumnExpr("sum(exchange_cash_person_list.exchanged_cash) AS cash")
queryPeople = queryPeople.ColumnExpr("sum(exchange_cash_person_list.exchanged_su_money) AS su_money")
queryPeople = queryPeople.ColumnExpr("ROW_NUMBER() OVER (ORDER BY sum(exchange_cash_person_list.exchanged_su_money) DESC) AS ranking")
queryPeople = queryPeople.Where("e.status = ?", 1)
//queryPeople = queryPeople.Where("e.status = ?", 1)
if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
queryPeople = queryPeople.Where("e.company_id = ?", companyId)
}
... ... @@ -123,7 +123,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac
queryListSuMoney := tx.Model(exchangeCashPersonListModels)
queryListSuMoney = queryListSuMoney.Join("JOIN employees AS e ON e.uid = exchange_cash_person_list.uid")
queryListSuMoney = queryListSuMoney.ColumnExpr("sum(exchange_cash_person_list.exchanged_su_money) AS activity_exchanged_su_money")
queryListSuMoney = queryListSuMoney.Where("e.status = ?", 1)
//queryListSuMoney = queryListSuMoney.Where("e.status = ?", 1)
if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
queryListSuMoney = queryListSuMoney.Where("e.company_id = ?", companyId)
}
... ... @@ -139,7 +139,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac
queryListCash := tx.Model(exchangeCashPersonListModels)
queryListCash = queryListCash.Join("JOIN employees AS e ON e.uid = exchange_cash_person_list.uid")
queryListCash = queryListCash.ColumnExpr("sum(exchange_cash_person_list.exchanged_cash) AS activity_exchanged_cash")
queryListCash = queryListCash.Where("e.status = ?", 1)
//queryListCash = queryListCash.Where("e.status = ?", 1)
if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
queryListCash = queryListCash.Where("e.company_id = ?", companyId)
}
... ...