调整商户注册逻辑
This commit is contained in:
@ -199,8 +199,22 @@ func (s *sUser) BindPhone(ctx context.Context, in *model.UserBindPhoneIn) (out *
|
||||
}
|
||||
|
||||
func (s *sUser) List(ctx context.Context, in *model.UserListIn) (out *model.UserListOut, err error) {
|
||||
// 用于系统管理员、商户、门店查看用户列表, 展示用户最近的相关信息
|
||||
return
|
||||
list := make([]model.User, 0)
|
||||
var total int
|
||||
orm := dao.Users.Ctx(ctx)
|
||||
if in.Nickname != "" {
|
||||
orm = orm.WhereLike(dao.Users.Columns().Nickname, "%"+in.Nickname+"%")
|
||||
}
|
||||
if err = orm.Page(in.Page, in.Size).LeftJoin(
|
||||
dao.Stores.Table(),
|
||||
fmt.Sprintf("%s.%s = %s.%s", dao.Users.Table(), dao.Users.Columns().LastLoginStoreId, dao.Stores.Table(), dao.Stores.Columns().Id),
|
||||
).Fields(fmt.Sprintf("%s.*, %s.%s %s", dao.Users.Table(), dao.Stores.Table(), dao.Stores.Columns().Name, "last_login_store_name")).ScanAndCount(&list, &total, false); err != nil {
|
||||
return nil, ecode.Fail.Sub("获取用户列表失败")
|
||||
}
|
||||
return &model.UserListOut{
|
||||
List: list,
|
||||
Total: total,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *sUser) BoundUrl(ctx context.Context, in *model.UserBoundUrlIn) (out *model.UserBoundUrlOut, err error) {
|
||||
|
||||
Reference in New Issue
Block a user