作者 陈志颖

test:昨日收益

@@ -101,8 +101,8 @@ func (dao *EmployeeDao) CalculatePersonSuMoney(uid int64) (map[string]interface{ @@ -101,8 +101,8 @@ func (dao *EmployeeDao) CalculatePersonSuMoney(uid int64) (map[string]interface{
101 ColumnExpr("sum(su_money_transaction_record.su_money) AS income_su_money"). 101 ColumnExpr("sum(su_money_transaction_record.su_money) AS income_su_money").
102 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid). 102 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid).
103 Where(`su_money_transaction_record.record_type = ?`, 2). 103 Where(`su_money_transaction_record.record_type = ?`, 2).
104 - Where(`su_money_transaction_record.create_time > ?`, time.Date(yesterday.Year(), yesterday.Month(), yesterday.Day(), 0, 0, 0, 0, yesterday.Location())).  
105 - Where(`su_money_transaction_record.create_time < ?`, time.Date(yesterday.Year(), yesterday.Month(), yesterday.Day(), 23, 59, 59, 0, yesterday.Location())). 104 + Where(`su_money_transaction_record.create_time > ?`, time.Date(yesterday.Year(), yesterday.Month(), yesterday.Day(), 0, 0, 0, 0, time.Local)).
  105 + Where(`su_money_transaction_record.create_time < ?`, time.Date(yesterday.Year(), yesterday.Month(), yesterday.Day(), 23, 59, 59, 0, time.Local)).
106 Select(&incomeSuMoneyOfYesterday); err != nil { 106 Select(&incomeSuMoneyOfYesterday); err != nil {
107 return nil, err 107 return nil, err
108 } 108 }
@@ -312,6 +312,9 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter @@ -312,6 +312,9 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter
312 tx := dao.transactionContext.PgTx 312 tx := dao.transactionContext.PgTx
313 suMoneyTransactionRecordModel := new(models.SuMoneyTransactionRecord) 313 suMoneyTransactionRecordModel := new(models.SuMoneyTransactionRecord)
314 314
  315 + queryWealthRestore := tx.Model(suMoneyTransactionRecordModel)
  316 +
  317 +
315 // 财富值榜单(素币) 318 // 财富值榜单(素币)
316 queryWealth := tx.Model(suMoneyTransactionRecordModel) 319 queryWealth := tx.Model(suMoneyTransactionRecordModel)
317 queryWealth = queryWealth.Join("JOIN employees AS e ON e.uid = (su_money_transaction_record.employee->>'uid')::bigint") 320 queryWealth = queryWealth.Join("JOIN employees AS e ON e.uid = (su_money_transaction_record.employee->>'uid')::bigint")