...
|
...
|
@@ -454,7 +454,7 @@ func (svr *PgLoginService) RegistryUser(phone string) error { |
|
|
isUserSenior bool
|
|
|
)
|
|
|
|
|
|
partnerInfo, _ := PartnerInfoService.FindOne(map[string]interface{}{"account": phone, "isNot": constant.DEFAULT_GUEST_COMPANY}) // 合伙人在正常公司是否存在
|
|
|
partnerInfo, errPartner := PartnerInfoService.FindOne(map[string]interface{}{"account": phone, "isNot": constant.DEFAULT_GUEST_COMPANY}) // 合伙人在正常公司是否存在
|
|
|
if partnerInfo == nil {
|
|
|
isPartner = false
|
|
|
} else {
|
...
|
...
|
@@ -480,7 +480,7 @@ func (svr *PgLoginService) RegistryUser(phone string) error { |
|
|
isGuestPartnerAvailable = true
|
|
|
}
|
|
|
|
|
|
user, _ := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "deleteAtIsNull": true}) // 用户是否存在
|
|
|
user, errUser := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "deleteAtIsNull": true}) // 用户是否存在
|
|
|
if user == nil {
|
|
|
isUser = false
|
|
|
} else {
|
...
|
...
|
@@ -571,27 +571,27 @@ func (svr *PgLoginService) RegistryUser(phone string) error { |
|
|
|
|
|
// 合伙人不存在、用户存在、非高管(普通用户)-> 注册用户
|
|
|
// 合伙人不存在、用户不存在(游客)-> 注册用户
|
|
|
//if errPartner != nil && errUser == nil && errSenior == nil || errPartner != nil && errUser != nil {
|
|
|
// id := time.Now().Unix()
|
|
|
// errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
|
|
|
// Id: id,
|
|
|
// CompanyId: int64(constant.DEFAULT_GUEST_COMPANY),
|
|
|
// PartnerName: phone,
|
|
|
// Account: phone,
|
|
|
// Password: "7c4a8d09ca3762af61e59520943dc26494f8941b",
|
|
|
// Status: 1,
|
|
|
// PartnerCategory: 1,
|
|
|
// RegionInfo: &domain.RegionInfo{
|
|
|
// RegionName: "客户区域",
|
|
|
// RegionId: 0,
|
|
|
// },
|
|
|
// CooperateTime: time.Now(),
|
|
|
// CreateAt: time.Now(),
|
|
|
// UpdateAt: time.Now(),
|
|
|
// PartnerCategoryInfos: []*models.PartnerCategoryInfo{&models.PartnerCategoryInfo{Id: 1, Code: phone}},
|
|
|
// Salesman: []*domain.Salesman{&domain.Salesman{Name: phone, Telephone: phone}},
|
|
|
// })
|
|
|
//}
|
|
|
if errPartner != nil && errUser == nil {
|
|
|
id := time.Now().Unix()
|
|
|
errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
|
|
|
Id: id,
|
|
|
CompanyId: int64(constant.DEFAULT_GUEST_COMPANY),
|
|
|
PartnerName: phone,
|
|
|
Account: phone,
|
|
|
Password: "7c4a8d09ca3762af61e59520943dc26494f8941b",
|
|
|
Status: 1,
|
|
|
PartnerCategory: 1,
|
|
|
RegionInfo: &domain.RegionInfo{
|
|
|
RegionName: "客户区域",
|
|
|
RegionId: 0,
|
|
|
},
|
|
|
CooperateTime: time.Now(),
|
|
|
CreateAt: time.Now(),
|
|
|
UpdateAt: time.Now(),
|
|
|
PartnerCategoryInfos: []*models.PartnerCategoryInfo{&models.PartnerCategoryInfo{Id: 1, Code: phone}},
|
|
|
Salesman: []*domain.Salesman{&domain.Salesman{Name: phone, Telephone: phone}},
|
|
|
})
|
|
|
}
|
|
|
|
|
|
return errPartner
|
|
|
}
|
...
|
...
|
@@ -627,7 +627,7 @@ func (svr *PgLoginService) RegistryGuest(phone string) error { |
|
|
CooperateTime: time.Now(),
|
|
|
CreateAt: time.Now(),
|
|
|
UpdateAt: time.Now(),
|
|
|
PartnerCategoryInfos: []*models.PartnerCategoryInfo{&models.PartnerCategoryInfo{Id: 1}},
|
|
|
PartnerCategoryInfos: []*models.PartnerCategoryInfo{&models.PartnerCategoryInfo{Id: 1, Code: phone}},
|
|
|
Salesman: []*domain.Salesman{&domain.Salesman{Name: phone, Telephone: phone}},
|
|
|
})
|
|
|
}
|
...
|
...
|
|