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