作者 陈志颖

合并分支 'dev' 到 'test'

fix:账号禁用



查看合并请求 !40
@@ -493,11 +493,14 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco @@ -493,11 +493,14 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco
493 loginSvr = domain_service.NewPgLoginService(transactionContext) 493 loginSvr = domain_service.NewPgLoginService(transactionContext)
494 claim *utils.UserTokenClaims 494 claim *utils.UserTokenClaims
495 ) 495 )
  496 +
496 rsp = &protocolx.CompanysResponse{} 497 rsp = &protocolx.CompanysResponse{}
  498 +
497 if err = transactionContext.StartTransaction(); err != nil { 499 if err = transactionContext.StartTransaction(); err != nil {
498 log.Error(err) 500 log.Error(err)
499 return nil, err 501 return nil, err
500 } 502 }
  503 +
501 defer func() { 504 defer func() {
502 transactionContext.RollbackTransaction() 505 transactionContext.RollbackTransaction()
503 }() 506 }()
@@ -517,7 +520,7 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco @@ -517,7 +520,7 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco
517 } 520 }
518 521
519 // loginSvr 初始化 522 // loginSvr 初始化
520 - loginSvr.Init(claim.Phone) 523 + _ = loginSvr.Init(claim.Phone)
521 524
522 // 高管标志位初始化 525 // 高管标志位初始化
523 _ = loginSvr.InitSenior(claim.Phone) 526 _ = loginSvr.InitSenior(claim.Phone)
@@ -525,6 +528,11 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco @@ -525,6 +528,11 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco
525 // 合伙人标志位初始化 528 // 合伙人标志位初始化
526 _ = loginSvr.InitPartner(claim.Phone) 529 _ = loginSvr.InitPartner(claim.Phone)
527 530
  531 + if len(loginSvr.PartnerInfo) == 0 && len(loginSvr.Users) == 0 {
  532 + err = protocol.NewErrWithMessage(10006)
  533 + return
  534 + }
  535 +
528 rsp.Partner, _ = loginSvr.PartnerStaticInfo() 536 rsp.Partner, _ = loginSvr.PartnerStaticInfo()
529 rsp.Manager, _ = loginSvr.ManagerStaticInfo() 537 rsp.Manager, _ = loginSvr.ManagerStaticInfo()
530 538
@@ -341,6 +341,7 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { @@ -341,6 +341,7 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) {
341 response["companys"] = companys 341 response["companys"] = companys
342 return response, nil 342 return response, nil
343 } 343 }
  344 +
344 func (svr *PgLoginService) GetCompanyList(funcGetCompanyIds func() []int64) []*domain.Company { 345 func (svr *PgLoginService) GetCompanyList(funcGetCompanyIds func() []int64) []*domain.Company {
345 var ( 346 var (
346 CompanyRepository, _ = repository.NewCompanyRepository(svr.transactionContext) 347 CompanyRepository, _ = repository.NewCompanyRepository(svr.transactionContext)
@@ -358,6 +359,7 @@ func (svr *PgLoginService) GetCompanyList(funcGetCompanyIds func() []int64) []*d @@ -358,6 +359,7 @@ func (svr *PgLoginService) GetCompanyList(funcGetCompanyIds func() []int64) []*d
358 } 359 }
359 return companyList 360 return companyList
360 } 361 }
  362 +
361 func (svr *PgLoginService) GetJoinWays(partnerCategory []*domain.PartnerCategoryInfo, partnerInfo *domain.PartnerInfo, bonus float64) []joinWay { 363 func (svr *PgLoginService) GetJoinWays(partnerCategory []*domain.PartnerCategoryInfo, partnerInfo *domain.PartnerInfo, bonus float64) []joinWay {
362 searchCategory := func(partnerCategory []*domain.PartnerCategoryInfo, id int64) *domain.PartnerCategoryInfo { 364 searchCategory := func(partnerCategory []*domain.PartnerCategoryInfo, id int64) *domain.PartnerCategoryInfo {
363 for i := range partnerCategory { 365 for i := range partnerCategory {