fix the problem that the time zone of the modify balance transaction generated by creating a new account was wrong

This commit is contained in:
MaysWind
2023-08-20 00:48:42 +08:00
parent 292b49ba79
commit aa717ed1fe
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -151,7 +151,7 @@ func (s *AccountService) GetMaxSubAccountDisplayOrder(uid int64, category models
}
// CreateAccounts saves a new account model to database
func (s *AccountService) CreateAccounts(mainAccount *models.Account, childrenAccounts []*models.Account) error {
func (s *AccountService) CreateAccounts(mainAccount *models.Account, childrenAccounts []*models.Account, utcOffset int16) error {
if mainAccount.Uid <= 0 {
return errs.ErrUserIdInvalid
}
@@ -190,6 +190,7 @@ func (s *AccountService) CreateAccounts(mainAccount *models.Account, childrenAcc
Deleted: false,
Type: models.TRANSACTION_DB_TYPE_MODIFY_BALANCE,
TransactionTime: transactionTime,
TimezoneUtcOffset: utcOffset,
AccountId: allAccounts[i].AccountId,
Amount: allAccounts[i].Balance,
RelatedAccountId: allAccounts[i].AccountId,