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