正在显示
4 个修改的文件
包含
10 行增加
和
11 行删除
@@ -2,11 +2,11 @@ package constant | @@ -2,11 +2,11 @@ package constant | ||
2 | 2 | ||
3 | import "os" | 3 | import "os" |
4 | 4 | ||
5 | -var POSTGRESQL_DB_NAME = "partner_dev" //partner | ||
6 | -var POSTGRESQL_USER = "postgres" // | ||
7 | -var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123 | ||
8 | -var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1 | ||
9 | -var POSTGRESQL_PORT = "31543" //5432 | 5 | +var POSTGRESQL_DB_NAME = "partner_test" //partner |
6 | +var POSTGRESQL_USER = "postgres" // | ||
7 | +var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123 | ||
8 | +var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1 | ||
9 | +var POSTGRESQL_PORT = "31543" //5432 | ||
10 | var DISABLE_CREATE_TABLE = false | 10 | var DISABLE_CREATE_TABLE = false |
11 | var DISABLE_SQL_GENERATE_PRINT = false | 11 | var DISABLE_SQL_GENERATE_PRINT = false |
12 | 12 |
@@ -45,6 +45,9 @@ func errResolve(errPartner, errManager error) (err error) { | @@ -45,6 +45,9 @@ func errResolve(errPartner, errManager error) (err error) { | ||
45 | } | 45 | } |
46 | if errPartner != nil && errManager != nil { | 46 | if errPartner != nil && errManager != nil { |
47 | err = errPartner | 47 | err = errPartner |
48 | + if err == errUserNotFound && errPartner != errUserNotFound { | ||
49 | + err = errManager | ||
50 | + } | ||
48 | return | 51 | return |
49 | } | 52 | } |
50 | return | 53 | return |
@@ -31,7 +31,7 @@ func (svr *PgLoginService) Init(phone string) (err error) { | @@ -31,7 +31,7 @@ func (svr *PgLoginService) Init(phone string) (err error) { | ||
31 | ) | 31 | ) |
32 | svr.Phone = phone | 32 | svr.Phone = phone |
33 | _, svr.PartnerInfo, err = PartnerInfoService.Find(map[string]interface{}{"account": phone, "status": 1, "sortByCreateTime": "ASC"}) | 33 | _, svr.PartnerInfo, err = PartnerInfoService.Find(map[string]interface{}{"account": phone, "status": 1, "sortByCreateTime": "ASC"}) |
34 | - _, svr.Users, err = UsersRepository.Find(map[string]interface{}{"phone": phone, "status": 1, "sortByCreateTime": "ASC"}) | 34 | + _, svr.Users, err = UsersRepository.Find(map[string]interface{}{"phone": phone, "status": 1, "sortByCreateTime": "ASC", "deleteAtIsNull": true}) |
35 | return nil | 35 | return nil |
36 | } | 36 | } |
37 | 37 | ||
@@ -183,11 +183,6 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { | @@ -183,11 +183,6 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { | ||
183 | break | 183 | break |
184 | } | 184 | } |
185 | } | 185 | } |
186 | - // 删除跳过 | ||
187 | - if user.DeleteAt.Unix() > 0 { | ||
188 | - log.Debug("【检查权限】", svr.Phone, "【公司】", c.Id, user.Id, 0, "已删除,跳过") | ||
189 | - continue | ||
190 | - } | ||
191 | if user != nil { | 186 | if user != nil { |
192 | if code, e := adminApiGateway.UserAuth(user.Id, constant.BUSINESS_ADMIN_PLATFORM_ID); e != nil || code != 0 { | 187 | if code, e := adminApiGateway.UserAuth(user.Id, constant.BUSINESS_ADMIN_PLATFORM_ID); e != nil || code != 0 { |
193 | log.Debug("【检查权限】", svr.Phone, "【公司】", c.Id, user.Id, code, e.Error()) | 188 | log.Debug("【检查权限】", svr.Phone, "【公司】", c.Id, user.Id, code, e.Error()) |
@@ -70,6 +70,7 @@ func (repository *UsersRepository) Find(queryOptions map[string]interface{}) (in | @@ -70,6 +70,7 @@ func (repository *UsersRepository) Find(queryOptions map[string]interface{}) (in | ||
70 | SetWhere("phone = ?", "phone"). | 70 | SetWhere("phone = ?", "phone"). |
71 | SetWhere("company_id = ?", "companyId"). | 71 | SetWhere("company_id = ?", "companyId"). |
72 | SetWhere(`status = ?`, "status"). | 72 | SetWhere(`status = ?`, "status"). |
73 | + SetWhere(`delete_at is null`, "deleteAtIsNull"). | ||
73 | SetOrder("create_at", "sortByCreateTime"). | 74 | SetOrder("create_at", "sortByCreateTime"). |
74 | SetOrder("update_at", "sortByUpdateTime") | 75 | SetOrder("update_at", "sortByUpdateTime") |
75 | var err error | 76 | var err error |
-
请 注册 或 登录 后发表评论