作者 yangfu

修改按职位查询

... ... @@ -34,7 +34,7 @@ func (l *MiniUserLoginLogic) MiniUserLogin(req *types.MiniUserLoginRequest) (res
var (
loginInfo *domain.LoginInfo
token string
loginCreator domain.LoginCreator = WXStuClientLogin{l: l}
loginCreator domain.LoginCreator = WxClientLogin{l: l}
)
switch req.LoginType {
case domain.LoginTypeWechatLogin:
... ... @@ -73,11 +73,11 @@ func (l *MiniUserLoginLogic) MiniUserLogin(req *types.MiniUserLoginRequest) (res
return
}
type WXStuClientLogin struct {
type WxClientLogin struct {
l *MiniUserLoginLogic
}
func (c WXStuClientLogin) WechatPhoneLogin(r domain.WechatLoginRequest) (*domain.LoginInfo, error) {
func (c WxClientLogin) WechatPhoneLogin(r domain.WechatLoginRequest) (*domain.LoginInfo, error) {
code := r.Code
miniprogram := wechat.NewWechat().GetMiniProgram(&miniConfig.Config{
AppID: c.l.svcCtx.Config.Wechat.AppID,
... ... @@ -108,15 +108,15 @@ func (c WXStuClientLogin) WechatPhoneLogin(r domain.WechatLoginRequest) (*domain
return response, nil
}
func (c WXStuClientLogin) WechatLogin(r domain.WechatLoginRequest) (*domain.LoginInfo, error) {
func (c WxClientLogin) WechatLogin(r domain.WechatLoginRequest) (*domain.LoginInfo, error) {
return nil, nil
}
func (c WXStuClientLogin) PhonePasswordLogin(phone string, password string) (*domain.LoginInfo, error) {
func (c WxClientLogin) PhonePasswordLogin(phone string, password string) (*domain.LoginInfo, error) {
panic("implement me")
}
func (c WXStuClientLogin) PhoneSmsCodeLogin(phone string, code string) (*domain.LoginInfo, error) {
func (c WxClientLogin) PhoneSmsCodeLogin(phone string, code string) (*domain.LoginInfo, error) {
var (
users []*domain.User
err error
... ...
... ... @@ -39,7 +39,7 @@ func (l *SystemUserSearchLogic) SystemUserSearch(req *types.SystemUserSearchRequ
queryOptions := domain.IndexCompanyId(userToken.CompanyId)().WithOffsetLimit(req.Page, req.Size).WithOrder("id desc").
WithKV("likeName", req.Name).
WithKV("likePhone", req.Phone).
WithKV("likePosition", req.Position).
WithKV("position", req.Position).
WithKV("enable", req.Enable).
WithKV("departmentId", req.DepartmentId)
if total, users, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOptions); err != nil {
... ...
... ... @@ -166,6 +166,9 @@ func (repository *UserRepository) Find(ctx context.Context, conn transaction.Con
if v, ok := queryOptions["likePhone"]; ok {
tx.Where("phone like ? ", fmt.Sprintf("%%%v%%", v))
}
if v, ok := queryOptions["position"]; ok {
tx.Where("position = ? ", v)
}
if v, ok := queryOptions["departmentId"]; ok {
tx.Where(fmt.Sprintf("departments @>'[%v]'", v))
}
... ...
... ... @@ -45,7 +45,7 @@ type ArticleRepository interface {
IncreaseCountComment(ctx context.Context, conn transaction.Conn, incr int, articleId int64) error //评论数量变动
IncreaseCountRead(ctx context.Context, conn transaction.Conn, incr int, articleId int64) error //浏览数量变动
// 小程序端搜索查询文章
// CustomSearchBy 小程序端搜索查询文章
// userId 人员id,谁查看文章
// companyId 公司id
// tagCategory 标签分类
... ...