作者 陈志颖

合并分支 'dev' 到 'test'

fix:账号禁用



查看合并请求 !40
... ... @@ -493,11 +493,14 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco
loginSvr = domain_service.NewPgLoginService(transactionContext)
claim *utils.UserTokenClaims
)
rsp = &protocolx.CompanysResponse{}
if err = transactionContext.StartTransaction(); err != nil {
log.Error(err)
return nil, err
}
defer func() {
transactionContext.RollbackTransaction()
}()
... ... @@ -517,7 +520,7 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco
}
// loginSvr 初始化
loginSvr.Init(claim.Phone)
_ = loginSvr.Init(claim.Phone)
// 高管标志位初始化
_ = loginSvr.InitSenior(claim.Phone)
... ... @@ -525,6 +528,11 @@ func CompaniesLoginByCredential(header *protocol.RequestHeader, request *protoco
// 合伙人标志位初始化
_ = loginSvr.InitPartner(claim.Phone)
if len(loginSvr.PartnerInfo) == 0 && len(loginSvr.Users) == 0 {
err = protocol.NewErrWithMessage(10006)
return
}
rsp.Partner, _ = loginSvr.PartnerStaticInfo()
rsp.Manager, _ = loginSvr.ManagerStaticInfo()
... ...
... ... @@ -341,6 +341,7 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) {
response["companys"] = companys
return response, nil
}
func (svr *PgLoginService) GetCompanyList(funcGetCompanyIds func() []int64) []*domain.Company {
var (
CompanyRepository, _ = repository.NewCompanyRepository(svr.transactionContext)
... ... @@ -358,6 +359,7 @@ func (svr *PgLoginService) GetCompanyList(funcGetCompanyIds func() []int64) []*d
}
return companyList
}
func (svr *PgLoginService) GetJoinWays(partnerCategory []*domain.PartnerCategoryInfo, partnerInfo *domain.PartnerInfo, bonus float64) []joinWay {
searchCategory := func(partnerCategory []*domain.PartnerCategoryInfo, id int64) *domain.PartnerCategoryInfo {
for i := range partnerCategory {
... ...