fix database selection or db transaction usage bug

This commit is contained in:
MaysWind
2021-01-18 01:23:54 +08:00
parent 51b0ae8076
commit bdc7188f8b
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -274,7 +274,7 @@ func (s *AccountService) DeleteAccount(uid int64, accountId int64) error {
return s.UserDataDB(uid).DoTransaction(func(sess *xorm.Session) error {
var accountAndSubAccounts []*models.Account
err := s.UserDataDB(uid).Where("uid=? AND deleted=? AND (account_id=? OR parent_account_id=?)", uid, false, accountId, accountId).Find(&accountAndSubAccounts)
err := sess.Where("uid=? AND deleted=? AND (account_id=? OR parent_account_id=?)", uid, false, accountId, accountId).Find(&accountAndSubAccounts)
if err != nil {
return err