|
@@ -362,32 +362,27 @@ func computeBonusPercent(totalBonus float64, bonus float64) float64 { |
|
@@ -362,32 +362,27 @@ func computeBonusPercent(totalBonus float64, bonus float64) float64 { |
362
|
|
362
|
|
363
|
/**
|
363
|
/**
|
364
|
* @Author SteveChan
|
364
|
* @Author SteveChan
|
365
|
- * @Description //TODO 注册用户到合伙人
|
365
|
+ * @Description // 注册用户到合伙人
|
366
|
* @Date 13:52 2021/1/13
|
366
|
* @Date 13:52 2021/1/13
|
367
|
* @Param
|
367
|
* @Param
|
368
|
* @return
|
368
|
* @return
|
369
|
**/
|
369
|
**/
|
370
|
-func (svr *PgLoginService) RegistryPartner(phone string, users []*domain.Users) error {
|
370
|
+func (svr *PgLoginService) RegistryUser(phone string) error {
|
371
|
var (
|
371
|
var (
|
372
|
PartnerInfoService, _ = repository.NewPartnerInfoRepository(svr.transactionContext)
|
372
|
PartnerInfoService, _ = repository.NewPartnerInfoRepository(svr.transactionContext)
|
373
|
- //UsersRepository, _ = repository.NewUsersRepository(svr.transactionContext)
|
|
|
374
|
)
|
373
|
)
|
375
|
|
374
|
|
376
|
partnerInfo, errPartner := PartnerInfoService.FindOne(map[string]interface{}{"account": phone})
|
375
|
partnerInfo, errPartner := PartnerInfoService.FindOne(map[string]interface{}{"account": phone})
|
377
|
|
376
|
|
378
|
- //user, errUser := UsersRepository.FindOne(map[string]interface{}{"phone": phone})
|
|
|
379
|
-
|
|
|
380
|
if partnerInfo != nil {
|
377
|
if partnerInfo != nil {
|
381
|
return nil
|
378
|
return nil
|
382
|
}
|
379
|
}
|
383
|
|
380
|
|
384
|
- for _, user := range users {
|
|
|
385
|
- if user.IsSenior == 2 { // 插入合伙人到非高管公司
|
|
|
386
|
if errPartner != nil {
|
381
|
if errPartner != nil {
|
387
|
id := time.Now().Unix()
|
382
|
id := time.Now().Unix()
|
388
|
errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
|
383
|
errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
|
389
|
Id: id,
|
384
|
Id: id,
|
390
|
- CompanyId: user.CompanyId,
|
385
|
+ CompanyId: int64(constant.DEFAULT_GUEST_COMPANY),
|
391
|
PartnerName: phone,
|
386
|
PartnerName: phone,
|
392
|
Account: phone,
|
387
|
Account: phone,
|
393
|
Password: "7c4a8d09ca3762af61e59520943dc26494f8941b",
|
388
|
Password: "7c4a8d09ca3762af61e59520943dc26494f8941b",
|
|
@@ -404,8 +399,6 @@ func (svr *PgLoginService) RegistryPartner(phone string, users []*domain.Users) |
|
@@ -404,8 +399,6 @@ func (svr *PgLoginService) RegistryPartner(phone string, users []*domain.Users) |
404
|
Salesman: []*domain.Salesman{&domain.Salesman{Name: phone, Telephone: phone}},
|
399
|
Salesman: []*domain.Salesman{&domain.Salesman{Name: phone, Telephone: phone}},
|
405
|
})
|
400
|
})
|
406
|
}
|
401
|
}
|
407
|
- }
|
|
|
408
|
- }
|
|
|
409
|
|
402
|
|
410
|
return errPartner
|
403
|
return errPartner
|
411
|
}
|
404
|
}
|