From 70076c90fd5f171c9567bbc4421d90eeed271d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=AE=9D?= <981661921@qq.com> Date: Tue, 21 Oct 2025 15:04:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/internal/logic/admin/notice.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/internal/logic/admin/notice.go b/server/internal/logic/admin/notice.go index 8db1dfd..a8ecf3c 100644 --- a/server/internal/logic/admin/notice.go +++ b/server/internal/logic/admin/notice.go @@ -24,7 +24,6 @@ import ( "github.com/gogf/gf/v2/errors/gerror" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/os/gtime" - "github.com/gogf/gf/v2/util/gconv" ) type sAdminNotice struct{} @@ -162,7 +161,6 @@ func (s *sAdminNotice) View(ctx context.Context, in *adminin.NoticeViewInp) (res // api列表 不需要登陆 func (s *sAdminNotice) ApiList(ctx context.Context, in *adminin.NoticeListInp) (list []*adminin.NoticeViewModel, totalCount int, err error) { - mod := s.Model(ctx) if in.Title != "" { @@ -198,6 +196,7 @@ func (s *sAdminNotice) ApiList(ctx context.Context, in *adminin.NoticeListInp) ( return list, totalCount, err } + // List 获取列表 func (s *sAdminNotice) List(ctx context.Context, in *adminin.NoticeListInp) (list []*adminin.NoticeListModel, totalCount int, err error) { var memberId = contexts.GetUserId(ctx) @@ -369,8 +368,8 @@ func (s *sAdminNotice) messageIds(ctx context.Context, memberId int64) (ids []in Fields(dao.AdminNotice.Columns().Id). Where(dao.AdminNotice.Columns().Status, consts.StatusEnabled). Where( - s.Model(ctx, &handler.Option{FilterAuth: false}).Builder().WhereIn("type",[]int{consts.NoticeTypeNotify, consts.NoticeTypeNotice}). - WhereOr(s.Model(ctx, &handler.Option{FilterAuth: false}).Builder().Where("type", consts.NoticeTypeLetter).Wheref("receiver->>'$.key'= ?", gconv.String(memberId))), + s.Model(ctx, &handler.Option{FilterAuth: false}).Builder().WhereIn("type", []int{consts.NoticeTypeNotify, consts.NoticeTypeNotice}). + WhereOr(s.Model(ctx, &handler.Option{FilterAuth: false}).Builder().Where("type", consts.NoticeTypeLetter)), ).Array() if err != nil { err = gerror.Wrap(err, "获取我的消息失败!")