mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
code refactor
This commit is contained in:
+2
-2
@@ -92,9 +92,9 @@ func (a *AccountsApi) AccountGetHandler(c *core.Context) (interface{}, *errs.Err
|
|||||||
accountRespMap[acccountResp.Id] = acccountResp
|
accountRespMap[acccountResp.Id] = acccountResp
|
||||||
}
|
}
|
||||||
|
|
||||||
accountResp := accountRespMap[accountGetReq.Id]
|
accountResp, exists := accountRespMap[accountGetReq.Id]
|
||||||
|
|
||||||
if accountResp == nil {
|
if !exists {
|
||||||
return nil, errs.ErrAccountNotFound
|
return nil, errs.ErrAccountNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ func (s *AccountService) ModifyAccountDisplayOrders(uid int64, accounts []*model
|
|||||||
return s.UserDataDB(uid).DoTransaction(func(sess *xorm.Session) error {
|
return s.UserDataDB(uid).DoTransaction(func(sess *xorm.Session) error {
|
||||||
for i := 0; i < len(accounts); i++ {
|
for i := 0; i < len(accounts); i++ {
|
||||||
account := accounts[i]
|
account := accounts[i]
|
||||||
_, err := sess.Cols("display_order", "updated_unix_time").Where("account_id=? AND uid=? AND deleted=?", account.AccountId, account.Uid, false).Update(account)
|
_, err := sess.Cols("display_order", "updated_unix_time").Where("account_id=? AND uid=? AND deleted=?", account.AccountId, uid, false).Update(account)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user