Browse Source

update

master
shenjiachi 9 hours ago
parent
commit
c8eab82bd3
1 changed files with 1 additions and 4 deletions
  1. +1
    -4
      src/implement/user_relate_implement.go

+ 1
- 4
src/implement/user_relate_implement.go View File

@@ -140,7 +140,7 @@ func (u UserRelateDb) UpdateUserRelateBySession(session *xorm.Session, uid int64
} }


func (u UserRelateDb) UserRelatesCountByParentUid(uid int64, level int) (int64, error) { func (u UserRelateDb) UserRelatesCountByParentUid(uid int64, level int) (int64, error) {
var userRelate []model.UserRelate
var userRelate model.UserRelate
var total int64 var total int64
var err error var err error
sess := u.Db.Where("parent_uid = ?", uid) sess := u.Db.Where("parent_uid = ?", uid)
@@ -150,8 +150,5 @@ func (u UserRelateDb) UserRelatesCountByParentUid(uid int64, level int) (int64,
if total, err = sess.Asc("level").Count(&userRelate); err != nil { if total, err = sess.Asc("level").Count(&userRelate); err != nil {
return 0, zhios_order_relate_logx.Error(err) return 0, zhios_order_relate_logx.Error(err)
} }
if len(userRelate) == 0 {
return 0, nil
}
return total, nil return total, nil
} }

Loading…
Cancel
Save