作者 yangfu

Merge branch 'dev' into test

... ... @@ -40,6 +40,9 @@ func (l *MiniUserAuditListLogic) MiniUserAuditList(req *types.UserSearchRequest)
MustWithKV("accountFrom", []string{domain.AccountFromSearchJoin})
if req.AuditFlag != nil && *req.AuditFlag >= 0 {
queryOptions.MustWithKV("auditStatus", []int{*req.AuditFlag})
if *req.AuditFlag == 2 {
queryOptions.MustWithKV("unscoped", true)
}
}
if total, users, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOptions); err != nil {
return nil, xerr.NewErrMsgErr("查询审核列表失败", err)
... ...
... ... @@ -41,6 +41,11 @@ func (l *MiniUserAuditLogic) MiniUserAudit(req *types.MiniUserAuditRequest) (err
if user, err = l.svcCtx.UserRepository.UpdateWithVersion(ctx, conn, user); err != nil {
return err
}
if req.Status == domain.UserAuditStatusReject {
if user, err = l.svcCtx.UserRepository.Delete(ctx, conn, user); err != nil {
return err
}
}
return nil
}, true); err != nil {
return xerr.NewErrMsgErr("审核失败", err)
... ...
... ... @@ -144,6 +144,9 @@ func (repository *UserRepository) Find(ctx context.Context, conn transaction.Con
)
queryFunc := func() (interface{}, error) {
tx = tx.Model(&ms)
if v, ok := queryOptions["unscoped"]; ok && v.(bool) {
tx.Unscoped()
}
if v, ok := queryOptions["companyId"]; ok {
tx.Where("company_id = ?", v)
}
... ...