code refactor

This commit is contained in:
MaysWind
2020-11-16 01:28:31 +08:00
parent 84317975c8
commit 88a8961073
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -92,9 +92,9 @@ func (a *AccountsApi) AccountGetHandler(c *core.Context) (interface{}, *errs.Err
accountRespMap[acccountResp.Id] = acccountResp
}
accountResp := accountRespMap[accountGetReq.Id]
accountResp, exists := accountRespMap[accountGetReq.Id]
if accountResp == nil {
if !exists {
return nil, errs.ErrAccountNotFound
}
+1 -1
View File
@@ -197,7 +197,7 @@ func (s *AccountService) ModifyAccountDisplayOrders(uid int64, accounts []*model
return s.UserDataDB(uid).DoTransaction(func(sess *xorm.Session) error {
for i := 0; i < len(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 {
return err