...
|
...
|
@@ -213,7 +213,7 @@ func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) { |
|
|
return response, e
|
|
|
}
|
|
|
var mapCompanyAdminUsers map[int64]*domain.Users = make(map[int64]*domain.Users) //key:company_id value:domain.users
|
|
|
if _, adminUsers, e := UsersRepository.Find(map[string]interface{}{"inCompanyIds": doGetCompanyIds(), "adminType": 2, "deleteAtIsNull": true}); e == nil {
|
|
|
if _, adminUsers, e := UsersRepository.Find(map[string]interface{}{"inCompanyIds": doGetCompanyIds(), "adminType": 2, "deleteAtIsNull": true, "isSenior": 1}); e == nil {
|
|
|
for i := range adminUsers {
|
|
|
mapCompanyAdminUsers[adminUsers[i].CompanyId] = adminUsers[i]
|
|
|
}
|
...
|
...
|
@@ -278,8 +278,8 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { |
|
|
)
|
|
|
doGetCompanyIds := func() []int64 {
|
|
|
var companies []int64
|
|
|
for i := range svr.Users {
|
|
|
companies = append(companies, svr.Users[i].CompanyId)
|
|
|
for i := range svr.IsSenior {
|
|
|
companies = append(companies, svr.IsSenior[i].CompanyId)
|
|
|
}
|
|
|
return companies
|
|
|
}
|
...
|
...
|
@@ -291,9 +291,9 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { |
|
|
if constant.POSTGRESQL_DB_NAME != "partner_dev" {
|
|
|
//通过企业平台 校验模块权限
|
|
|
var user *domain.Users
|
|
|
for j := range svr.Users {
|
|
|
if svr.Users[j].CompanyId == c.Id {
|
|
|
user = svr.Users[j]
|
|
|
for j := range svr.IsSenior {
|
|
|
if svr.IsSenior[j].CompanyId == c.Id {
|
|
|
user = svr.IsSenior[j]
|
|
|
break
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -390,6 +390,7 @@ func (svr *PgLoginService) RegistryUser(phone string) error { |
|
|
)
|
|
|
|
|
|
partnerInfo, errPartner := PartnerInfoService.FindOne(map[string]interface{}{"account": phone, "isNot": constant.DEFAULT_GUEST_COMPANY}) // 合伙人是否存在
|
|
|
guestInfo, _ := PartnerInfoService.FindOne(map[string]interface{}{"account": phone, "companyId": constant.DEFAULT_GUEST_COMPANY}) // 合伙人是否存在
|
|
|
user, errUser := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "deleteAtIsNull": true}) // 用户是否存在
|
|
|
senior, errSenior := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "isSenior": 2, "deleteAtIsNull": true}) // 用户是否是高管
|
|
|
|
...
|
...
|
@@ -400,7 +401,8 @@ func (svr *PgLoginService) RegistryUser(phone string) error { |
|
|
// 合伙人存在、用户存在、是高管(高管合伙人)
|
|
|
// 合伙人不存在、用户存在、是高管(高管)|| partnerInfo == nil && user != nil && senior != nil
|
|
|
// 合伙人存在、用户存在、非高管(合伙人)
|
|
|
if partnerInfo != nil && user != nil && senior != nil || partnerInfo != nil && user != nil && senior == nil {
|
|
|
// 游客公司合伙人存在
|
|
|
if partnerInfo != nil && user != nil && senior != nil || partnerInfo != nil && user != nil && senior == nil || guestInfo != nil {
|
|
|
return nil
|
|
|
}
|
|
|
|
...
|
...
|
|