正在显示
6 个修改的文件
包含
10 行增加
和
6 行删除
@@ -8,8 +8,6 @@ import ( | @@ -8,8 +8,6 @@ import ( | ||
8 | _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg" | 8 | _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg" |
9 | _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/redis" | 9 | _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/redis" |
10 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log" | 10 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log" |
11 | - "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/sarama" | ||
12 | - | ||
13 | //"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/ginsvr" | 11 | //"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/ginsvr" |
14 | _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr" | 12 | _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr" |
15 | ) | 13 | ) |
@@ -26,7 +24,7 @@ func main() { | @@ -26,7 +24,7 @@ func main() { | ||
26 | event.InitEventCenter() | 24 | event.InitEventCenter() |
27 | 25 | ||
28 | //启动kafaka消息订阅 | 26 | //启动kafaka消息订阅 |
29 | - go sarama.Run() | 27 | + //go sarama.Run() |
30 | 28 | ||
31 | beego.Run() | 29 | beego.Run() |
32 | } | 30 | } |
@@ -365,7 +365,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom | @@ -365,7 +365,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom | ||
365 | transactionContext.RollbackTransaction() | 365 | transactionContext.RollbackTransaction() |
366 | }() | 366 | }() |
367 | // 通过短信验证码登录的游客,注册一个账号到配置的公司去(ios审核使用) | 367 | // 通过短信验证码登录的游客,注册一个账号到配置的公司去(ios审核使用) |
368 | - if request.GrantType == protocol.LoginBySmsCode { | 368 | + if request.GrantType == protocol.LoginBySmsCode || request.GrantType == protocol.LoginByPassword { |
369 | e := loginSvr.RegistryGuest(request.Phone) | 369 | e := loginSvr.RegistryGuest(request.Phone) |
370 | if e != nil { | 370 | if e != nil { |
371 | log.Error(e) | 371 | log.Error(e) |
@@ -46,6 +46,8 @@ type Users struct { | @@ -46,6 +46,8 @@ type Users struct { | ||
46 | AccessPartners []*PartnerInfo | 46 | AccessPartners []*PartnerInfo |
47 | // 1普通用户 2主管理员 | 47 | // 1普通用户 2主管理员 |
48 | AdminType int8 `json:"adminType"` | 48 | AdminType int8 `json:"adminType"` |
49 | + //是否是高管 | ||
50 | + IsSenior int64 `json:"is_senior"` | ||
49 | } | 51 | } |
50 | 52 | ||
51 | func (Users *Users) AccessPartnerIds() []int64 { | 53 | func (Users *Users) AccessPartnerIds() []int64 { |
@@ -34,7 +34,7 @@ func (svr *PgLoginService) Init(phone string) (err error) { | @@ -34,7 +34,7 @@ func (svr *PgLoginService) Init(phone string) (err error) { | ||
34 | ) | 34 | ) |
35 | svr.Phone = phone | 35 | svr.Phone = phone |
36 | _, svr.PartnerInfo, err = PartnerInfoService.Find(map[string]interface{}{"account": phone, "status": 1, "sortByCreateTime": "ASC"}) | 36 | _, svr.PartnerInfo, err = PartnerInfoService.Find(map[string]interface{}{"account": phone, "status": 1, "sortByCreateTime": "ASC"}) |
37 | - _, svr.Users, err = UsersRepository.Find(map[string]interface{}{"phone": phone, "status": 1, "sortByCreateTime": "ASC", "deleteAtIsNull": true}) | 37 | + _, svr.Users, err = UsersRepository.Find(map[string]interface{}{"phone": phone, "status": 1, "sortByCreateTime": "ASC", "deleteAtIsNull": true, "isSenior": 1}) |
38 | return nil | 38 | return nil |
39 | } | 39 | } |
40 | 40 | ||
@@ -291,7 +291,7 @@ func (svr *PgLoginService) RegistryGuest(phone string) error { | @@ -291,7 +291,7 @@ func (svr *PgLoginService) RegistryGuest(phone string) error { | ||
291 | UsersRepository, _ = repository.NewUsersRepository(svr.transactionContext) | 291 | UsersRepository, _ = repository.NewUsersRepository(svr.transactionContext) |
292 | ) | 292 | ) |
293 | partnerInfo, errPartner := PartnerInfoService.FindOne(map[string]interface{}{"account": phone}) | 293 | partnerInfo, errPartner := PartnerInfoService.FindOne(map[string]interface{}{"account": phone}) |
294 | - user, errUser := UsersRepository.FindOne(map[string]interface{}{"phone": phone}) | 294 | + user, errUser := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "isSenior": 1}) |
295 | if partnerInfo != nil || user != nil { | 295 | if partnerInfo != nil || user != nil { |
296 | return nil | 296 | return nil |
297 | } | 297 | } |
@@ -55,6 +55,7 @@ func (repository *UsersRepository) FindOne(queryOptions map[string]interface{}) | @@ -55,6 +55,7 @@ func (repository *UsersRepository) FindOne(queryOptions map[string]interface{}) | ||
55 | query.SetWhere("phone = ?", "phone") | 55 | query.SetWhere("phone = ?", "phone") |
56 | query.SetWhere("company_id = ?", "companyId") | 56 | query.SetWhere("company_id = ?", "companyId") |
57 | query.SetWhere(`delete_at is null`, "deleteAtIsNull") | 57 | query.SetWhere(`delete_at is null`, "deleteAtIsNull") |
58 | + query.SetWhere("is_senior = ?", "isSenior") | ||
58 | if err := query.First(); err != nil { | 59 | if err := query.First(); err != nil { |
59 | return nil, fmt.Errorf("query row not found") | 60 | return nil, fmt.Errorf("query row not found") |
60 | } | 61 | } |
@@ -81,6 +82,7 @@ func (repository *UsersRepository) Find(queryOptions map[string]interface{}) (in | @@ -81,6 +82,7 @@ func (repository *UsersRepository) Find(queryOptions map[string]interface{}) (in | ||
81 | query.Where("company_id in (?)", pg.In(v)) | 82 | query.Where("company_id in (?)", pg.In(v)) |
82 | } | 83 | } |
83 | query.SetWhere("admin_type=?", "adminType") | 84 | query.SetWhere("admin_type=?", "adminType") |
85 | + query.SetWhere("is_senior = ?", "isSenior") | ||
84 | var err error | 86 | var err error |
85 | if query.AffectRow, err = query.SelectAndCount(); err != nil { | 87 | if query.AffectRow, err = query.SelectAndCount(); err != nil { |
86 | return 0, Userss, err | 88 | return 0, Userss, err |
-
请 注册 或 登录 后发表评论