mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 05:12:32 +08:00
修复字典选项和公告提示加载异常,优化tcp和websocket消息处理
This commit is contained in:
@@ -190,13 +190,13 @@ func (s *sAdminDept) List(ctx context.Context, in adminin.DeptListInp) (res *adm
|
||||
|
||||
// 部门名称
|
||||
if in.Name != "" {
|
||||
columns, err := dao.AdminDept.Ctx(ctx).Fields("pid").WhereLike("name", "%"+in.Name+"%").All()
|
||||
columns, err := dao.AdminDept.Ctx(ctx).Fields("pid").WhereLike("name", "%"+in.Name+"%").Array()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, "过滤部门列表失败-1!")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ds := g.NewVar(columns.Array()).Int64s()
|
||||
ds := g.NewVar(columns).Int64s()
|
||||
ids = append(ids, ds...)
|
||||
pids = append(pids, ds...)
|
||||
if len(ids) == 0 {
|
||||
@@ -205,13 +205,13 @@ func (s *sAdminDept) List(ctx context.Context, in adminin.DeptListInp) (res *adm
|
||||
}
|
||||
|
||||
if in.Code != "" {
|
||||
columns, err := dao.AdminDept.Ctx(ctx).Fields("pid").WhereLike("code", "%"+in.Code+"%").All()
|
||||
columns, err := dao.AdminDept.Ctx(ctx).Fields("pid").WhereLike("code", "%"+in.Code+"%").Array()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, "过滤部门列表失败-2!")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ds := g.NewVar(columns.Array()).Int64s()
|
||||
ds := g.NewVar(columns).Int64s()
|
||||
ids = append(ids, ds...)
|
||||
pids = append(pids, ds...)
|
||||
if len(ids) == 0 {
|
||||
|
@@ -585,16 +585,13 @@ func (s *sAdminMember) List(ctx context.Context, in adminin.MemberListInp) (list
|
||||
}
|
||||
|
||||
for _, v := range list {
|
||||
columns, err := dao.AdminMemberPost.Ctx(ctx).
|
||||
Fields(dao.AdminMemberPost.Columns().PostId).
|
||||
Where(dao.AdminMemberPost.Columns().MemberId, v.Id).All()
|
||||
|
||||
columns, err := dao.AdminMemberPost.Ctx(ctx).Fields(dao.AdminMemberPost.Columns().PostId).Where(dao.AdminMemberPost.Columns().MemberId, v.Id).Array()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, "获取用户岗位数据失败!")
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
v.PostIds = g.NewVar(columns.Array()).Int64s()
|
||||
v.PostIds = g.NewVar(columns).Int64s()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@@ -81,6 +81,7 @@ func (s *sAdminMenu) VerifyUnique(ctx context.Context, in adminin.VerifyUniqueIn
|
||||
func (s *sAdminMenu) Edit(ctx context.Context, in adminin.MenuEditInp) (err error) {
|
||||
// 验证唯一性
|
||||
err = s.VerifyUnique(ctx, adminin.VerifyUniqueInp{
|
||||
Id: in.Id,
|
||||
Where: g.Map{
|
||||
dao.AdminMenu.Columns().Title: in.Title,
|
||||
dao.AdminMenu.Columns().Name: in.Name,
|
||||
|
@@ -327,7 +327,7 @@ func (s *sAdminNotice) messageIds(ctx context.Context, memberId int64) (ids []in
|
||||
Where("status", consts.StatusEnabled).
|
||||
Where("(`type` IN(?) OR (`type` = ? and JSON_CONTAINS(`receiver`,'"+gconv.String(memberId)+"')))",
|
||||
[]int{consts.NoticeTypeNotify, consts.NoticeTypeNotice}, consts.NoticeTypeLetter,
|
||||
).All()
|
||||
).Array()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, "获取我的消息失败!")
|
||||
return
|
||||
|
Reference in New Issue
Block a user