作者 yangfu

修改:用户中心注销登录

@@ -279,7 +279,7 @@ func UCenterRevoke(header *protocol.RequestHeader, userId int64) (rsp *protocol. @@ -279,7 +279,7 @@ func UCenterRevoke(header *protocol.RequestHeader, userId int64) (rsp *protocol.
279 transactionContext.RollbackTransaction() 279 transactionContext.RollbackTransaction()
280 }() 280 }()
281 281
282 - if user, err = UsersRepository.FindOne(map[string]interface{}{"id": userId}); err != nil { 282 + if user, err = UsersRepository.FindOne(map[string]interface{}{"openId": userId}); err != nil {
283 log.Error(err) 283 log.Error(err)
284 err = nil 284 err = nil
285 return 285 return
@@ -50,6 +50,7 @@ func (repository *UsersRepository) FindOne(queryOptions map[string]interface{}) @@ -50,6 +50,7 @@ func (repository *UsersRepository) FindOne(queryOptions map[string]interface{})
50 UsersModel := new(models.Users) 50 UsersModel := new(models.Users)
51 query := NewQuery(tx.Model(UsersModel), queryOptions) 51 query := NewQuery(tx.Model(UsersModel), queryOptions)
52 query.SetWhere("id = ?", "id") 52 query.SetWhere("id = ?", "id")
  53 + query.SetWhere("open_id = ?", "openId")
53 query.SetWhere("status = ?", "status") 54 query.SetWhere("status = ?", "status")
54 query.SetWhere("phone = ?", "phone") 55 query.SetWhere("phone = ?", "phone")
55 query.SetWhere("company_id = ?", "companyId") 56 query.SetWhere("company_id = ?", "companyId")