作者 陈志颖

fix:修改个人素币统计

@@ -208,7 +208,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf @@ -208,7 +208,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
208 func (dao *EmployeeDao) CalculateSuMoneyTransactionRecord(uid int64, transactionStartTime time.Time, transactionEndTime time.Time) (map[string]interface{}, error) { 208 func (dao *EmployeeDao) CalculateSuMoneyTransactionRecord(uid int64, transactionStartTime time.Time, transactionEndTime time.Time) (map[string]interface{}, error) {
209 var ( 209 var (
210 incomeSuMoney float64 // 收入的素币(2:任务奖励,3:增加 6: 兑换素币撤回) 210 incomeSuMoney float64 // 收入的素币(2:任务奖励,3:增加 6: 兑换素币撤回)
211 - expendSuMoney float64 // 消耗的素币(1:兑换物资,4:扣除, 211 + expendSuMoney float64 // 消耗的素币(1:兑换物资,4:扣除,5:兑换现金
212 expendSuMoneyExchange float64 // 5: 兑换现金 212 expendSuMoneyExchange float64 // 5: 兑换现金
213 incomeSuMoneyExchangeRestore float64 // 6: 兑换素币撤回 213 incomeSuMoneyExchangeRestore float64 // 6: 兑换素币撤回
214 ) 214 )
@@ -218,7 +218,7 @@ func (dao *EmployeeDao) CalculateSuMoneyTransactionRecord(uid int64, transaction @@ -218,7 +218,7 @@ func (dao *EmployeeDao) CalculateSuMoneyTransactionRecord(uid int64, transaction
218 if err := tx.Model(suMoneyTransactionRecordModel). 218 if err := tx.Model(suMoneyTransactionRecordModel).
219 ColumnExpr("sum(su_money_transaction_record.su_money) AS income_su_money"). 219 ColumnExpr("sum(su_money_transaction_record.su_money) AS income_su_money").
220 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid). 220 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid).
221 - Where(`su_money_transaction_record.record_type IN (?)`, pg.In([]int{2, 3})). 221 + Where(`su_money_transaction_record.record_type IN (?)`, pg.In([]int{2, 3, 6})).
222 Where(`su_money_transaction_record.create_time > ?`, transactionStartTime). 222 Where(`su_money_transaction_record.create_time > ?`, transactionStartTime).
223 Where(`su_money_transaction_record.create_time < ?`, transactionEndTime). 223 Where(`su_money_transaction_record.create_time < ?`, transactionEndTime).
224 Select(&incomeSuMoney); err != nil { 224 Select(&incomeSuMoney); err != nil {
@@ -228,7 +228,7 @@ func (dao *EmployeeDao) CalculateSuMoneyTransactionRecord(uid int64, transaction @@ -228,7 +228,7 @@ func (dao *EmployeeDao) CalculateSuMoneyTransactionRecord(uid int64, transaction
228 if err := tx.Model(suMoneyTransactionRecordModel). 228 if err := tx.Model(suMoneyTransactionRecordModel).
229 ColumnExpr("sum(su_money_transaction_record.su_money) AS expend_su_money"). 229 ColumnExpr("sum(su_money_transaction_record.su_money) AS expend_su_money").
230 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid). 230 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid).
231 - Where(`su_money_transaction_record.record_type IN (?)`, pg.In([]int{1, 4})). 231 + Where(`su_money_transaction_record.record_type IN (?)`, pg.In([]int{1, 4, 5})).
232 Where(`su_money_transaction_record.create_time > ?`, transactionStartTime). 232 Where(`su_money_transaction_record.create_time > ?`, transactionStartTime).
233 Where(`su_money_transaction_record.create_time < ?`, transactionEndTime). 233 Where(`su_money_transaction_record.create_time < ?`, transactionEndTime).
234 Select(&expendSuMoney); err != nil { 234 Select(&expendSuMoney); err != nil {