...
|
...
|
@@ -362,32 +362,27 @@ func computeBonusPercent(totalBonus float64, bonus float64) float64 { |
|
|
|
|
|
/**
|
|
|
* @Author SteveChan
|
|
|
* @Description //TODO 注册用户到合伙人
|
|
|
* @Description // 注册用户到合伙人
|
|
|
* @Date 13:52 2021/1/13
|
|
|
* @Param
|
|
|
* @return
|
|
|
**/
|
|
|
func (svr *PgLoginService) RegistryPartner(phone string, users []*domain.Users) error {
|
|
|
func (svr *PgLoginService) RegistryUser(phone string) error {
|
|
|
var (
|
|
|
PartnerInfoService, _ = repository.NewPartnerInfoRepository(svr.transactionContext)
|
|
|
//UsersRepository, _ = repository.NewUsersRepository(svr.transactionContext)
|
|
|
)
|
|
|
|
|
|
partnerInfo, errPartner := PartnerInfoService.FindOne(map[string]interface{}{"account": phone})
|
|
|
|
|
|
//user, errUser := UsersRepository.FindOne(map[string]interface{}{"phone": phone})
|
|
|
|
|
|
if partnerInfo != nil {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
for _, user := range users {
|
|
|
if user.IsSenior == 2 { // 插入合伙人到非高管公司
|
|
|
if errPartner != nil {
|
|
|
id := time.Now().Unix()
|
|
|
errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
|
|
|
Id: id,
|
|
|
CompanyId: user.CompanyId,
|
|
|
CompanyId: int64(constant.DEFAULT_GUEST_COMPANY),
|
|
|
PartnerName: phone,
|
|
|
Account: phone,
|
|
|
Password: "7c4a8d09ca3762af61e59520943dc26494f8941b",
|
...
|
...
|
@@ -404,8 +399,6 @@ func (svr *PgLoginService) RegistryPartner(phone string, users []*domain.Users) |
|
|
Salesman: []*domain.Salesman{&domain.Salesman{Name: phone, Telephone: phone}},
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return errPartner
|
|
|
}
|
...
|
...
|
|