...
|
...
|
@@ -130,7 +130,7 @@ func (dao *EmployeeDao) CalculateSystemSuMoney(companyId int64) (map[string] int |
|
|
}
|
|
|
// 系统已兑换现金素币
|
|
|
suMoneyTransactionRecordModel := new(models.SuMoneyTransactionRecord)
|
|
|
if err := tx.Model(suMoneyTransactionRecordModel).Join("JOIN employees AS e ON e.uid = (su_money_transaction_records.employee->>'uid')::bigint").
|
|
|
if err := tx.Model(suMoneyTransactionRecordModel).Join("JOIN employees AS e ON e.uid = (su_money_transaction_record.employee->>'uid')::bigint").
|
|
|
ColumnExpr("sum(su_money_transaction_record.su_money) AS system_changed_su_money").
|
|
|
Where("e.company_id = ?", companyId).
|
|
|
Where("e.status = ?", 1).
|
...
|
...
|
@@ -153,7 +153,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf |
|
|
)
|
|
|
// 系统已兑换现金
|
|
|
suMoneyTransactionRecordModel := new(models.SuMoneyTransactionRecord)
|
|
|
if err := tx.Model(suMoneyTransactionRecordModel).Join("JOIN employees AS e ON e.uid = (su_money_transaction_records.employee->>'uid')::bigint").
|
|
|
if err := tx.Model(suMoneyTransactionRecordModel).Join("JOIN employees AS e ON e.uid = (su_money_transaction_record.employee->>'uid')::bigint").
|
|
|
ColumnExpr("sum(su_money_transaction_record.cash) AS system_exchanged_cash").
|
|
|
Where("e.company_id = ?", companyId).
|
|
|
//Where(`e.status = ?`, 1).
|
...
|
...
|
@@ -165,7 +165,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf |
|
|
cashPool := new(models.CashPool)
|
|
|
if err := tx.Model(cashPool).
|
|
|
Column("un_exchange_cash").
|
|
|
Where("cash_pools.company_id = ?", companyId).
|
|
|
Where("cash_pool.company_id = ?", companyId).
|
|
|
Order("id DESC").
|
|
|
Limit(1).
|
|
|
Select(&systemUnExchangeCash) ; err != nil {
|
...
|
...
|
|