正在显示
3 个修改的文件
包含
11 行增加
和
0 行删除
@@ -40,6 +40,9 @@ func (l *MiniUserAuditListLogic) MiniUserAuditList(req *types.UserSearchRequest) | @@ -40,6 +40,9 @@ func (l *MiniUserAuditListLogic) MiniUserAuditList(req *types.UserSearchRequest) | ||
40 | MustWithKV("accountFrom", []string{domain.AccountFromSearchJoin}) | 40 | MustWithKV("accountFrom", []string{domain.AccountFromSearchJoin}) |
41 | if req.AuditFlag != nil && *req.AuditFlag >= 0 { | 41 | if req.AuditFlag != nil && *req.AuditFlag >= 0 { |
42 | queryOptions.MustWithKV("auditStatus", []int{*req.AuditFlag}) | 42 | queryOptions.MustWithKV("auditStatus", []int{*req.AuditFlag}) |
43 | + if *req.AuditFlag == 2 { | ||
44 | + queryOptions.MustWithKV("unscoped", true) | ||
45 | + } | ||
43 | } | 46 | } |
44 | if total, users, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOptions); err != nil { | 47 | if total, users, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOptions); err != nil { |
45 | return nil, xerr.NewErrMsgErr("查询审核列表失败", err) | 48 | return nil, xerr.NewErrMsgErr("查询审核列表失败", err) |
@@ -41,6 +41,11 @@ func (l *MiniUserAuditLogic) MiniUserAudit(req *types.MiniUserAuditRequest) (err | @@ -41,6 +41,11 @@ func (l *MiniUserAuditLogic) MiniUserAudit(req *types.MiniUserAuditRequest) (err | ||
41 | if user, err = l.svcCtx.UserRepository.UpdateWithVersion(ctx, conn, user); err != nil { | 41 | if user, err = l.svcCtx.UserRepository.UpdateWithVersion(ctx, conn, user); err != nil { |
42 | return err | 42 | return err |
43 | } | 43 | } |
44 | + if req.Status == domain.UserAuditStatusReject { | ||
45 | + if user, err = l.svcCtx.UserRepository.Delete(ctx, conn, user); err != nil { | ||
46 | + return err | ||
47 | + } | ||
48 | + } | ||
44 | return nil | 49 | return nil |
45 | }, true); err != nil { | 50 | }, true); err != nil { |
46 | return xerr.NewErrMsgErr("审核失败", err) | 51 | return xerr.NewErrMsgErr("审核失败", err) |
@@ -144,6 +144,9 @@ func (repository *UserRepository) Find(ctx context.Context, conn transaction.Con | @@ -144,6 +144,9 @@ func (repository *UserRepository) Find(ctx context.Context, conn transaction.Con | ||
144 | ) | 144 | ) |
145 | queryFunc := func() (interface{}, error) { | 145 | queryFunc := func() (interface{}, error) { |
146 | tx = tx.Model(&ms) | 146 | tx = tx.Model(&ms) |
147 | + if v, ok := queryOptions["unscoped"]; ok && v.(bool) { | ||
148 | + tx.Unscoped() | ||
149 | + } | ||
147 | if v, ok := queryOptions["companyId"]; ok { | 150 | if v, ok := queryOptions["companyId"]; ok { |
148 | tx.Where("company_id = ?", v) | 151 | tx.Where("company_id = ?", v) |
149 | } | 152 | } |
-
请 注册 或 登录 后发表评论