diff --git a/app/mix/dao/mongo.go b/app/mix/dao/mongo.go index 4d529110..f896431b 100644 --- a/app/mix/dao/mongo.go +++ b/app/mix/dao/mongo.go @@ -6622,7 +6622,7 @@ func (m *Mongo) ReadNotifReceiveByIds(ctx *gin.Context, req *notificationproto.A return result, err } -func (m *Mongo) ReadAllNotifReceive(ctx *gin.Context, nType int64) (*qmgo.UpdateResult, error) { +func (m *Mongo) ReadAllNotifReceive(ctx *gin.Context, mid, nType int64) (*qmgo.UpdateResult, error) { col := m.getColNotifReceive() update := qmgo.M{ "$set": qmgo.M{ @@ -6630,6 +6630,7 @@ func (m *Mongo) ReadAllNotifReceive(ctx *gin.Context, nType int64) (*qmgo.Update }, } filter := qmgo.M{ + "obj_mid": mid, "is_read": consts.NotifReceive_NotRead, "n_type": nType, } diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index f1a85a02..692286db 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -4706,7 +4706,7 @@ func (s *Service) ApiReadAllNotification(ctx *gin.Context, req *notificationprot for _, nType := range req.NTypes { // 标记已读 - result, err := _DefaultNotifReceive.OpReadAll(ctx, nType) + result, err := _DefaultNotifReceive.OpReadAll(ctx, req.BaseRequest.Mid, nType) if err != nil { logger.Error("_DefaultNotifReceive OpReadAll fail, req: %v, err: %v", util.ToJson(req), err) ec = errcode.ErrCodeNotificationSrvFail diff --git a/app/mix/service/logic/notif_receive.go b/app/mix/service/logic/notif_receive.go index cbd078ad..e695fcac 100644 --- a/app/mix/service/logic/notif_receive.go +++ b/app/mix/service/logic/notif_receive.go @@ -54,8 +54,8 @@ func (p *NotifReceive) OpReadByIds(ctx *gin.Context, req *notificationproto.ApiR return result, nil } -func (p *NotifReceive) OpReadAll(ctx *gin.Context, nType int64) (*qmgo.UpdateResult, error) { - result, err := p.store.ReadAllNotifReceive(ctx, nType) +func (p *NotifReceive) OpReadAll(ctx *gin.Context, mid, nType int64) (*qmgo.UpdateResult, error) { + result, err := p.store.ReadAllNotifReceive(ctx, mid, nType) if err != nil { logger.Error("ReadAllNotifReceive fail, err: %v", err) return nil, err