‘linchangsheng’ 5 月之前
父節點
當前提交
1b10466a79

+ 9 - 3
mall-server-api/src/main/java/com/gree/mall/manager/logic/notice/NoticeWebsitLogic.java

@@ -190,7 +190,9 @@ public class NoticeWebsitLogic {
 
             NoticeWebsit one = noticeWebsitService.getById(id);
             if (one != null){
-                one.setNum(one.getNum()+1);
+                one.setNum(noticeWebsitRecordService.lambdaQuery()
+                .eq(NoticeWebsitRecord::getNoticeWebsitId,id)
+                .eq(NoticeWebsitRecord::getReadFlag,IsYesNoEnum.YES.getKey()).count());
                 one.updateById();
             }
         }
@@ -220,7 +222,9 @@ public class NoticeWebsitLogic {
 
                 NoticeWebsit one = noticeWebsitService.getById(websitRecord.getNoticeWebsitId());
                 if (one != null){
-                    one.setNum(one.getNum()+1);
+                    one.setNum(noticeWebsitRecordService.lambdaQuery()
+                            .eq(NoticeWebsitRecord::getNoticeWebsitId,websitRecord.getNoticeWebsitId())
+                            .eq(NoticeWebsitRecord::getReadFlag,IsYesNoEnum.YES.getKey()).count());
                     one.updateById();
                 }
 
@@ -247,7 +251,9 @@ public class NoticeWebsitLogic {
             NoticeWebsitRecord noticeWebsitRecord = noticeWebsitRecordService.getById(idOne);
             NoticeWebsit one = noticeWebsitService.getById(noticeWebsitRecord.getNoticeWebsitId());
             if (one != null){
-                one.setNum(one.getNum()+1);
+                one.setNum(noticeWebsitRecordService.lambdaQuery()
+                        .eq(NoticeWebsitRecord::getNoticeWebsitId,id)
+                        .eq(NoticeWebsitRecord::getReadFlag,IsYesNoEnum.YES.getKey()).count());
                 one.updateById();
             }
         }