1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-28 13:21:37 +08:00

修正通知标记为已读,计数不归零问题

This commit is contained in:
koogua 2022-12-12 16:07:01 +08:00
parent 2145316913
commit 1f996ab384

View File

@ -17,6 +17,12 @@ class NotificationRead extends LogicService
{ {
$user = $this->getLoginUser(); $user = $this->getLoginUser();
if ($user->notice_count == 0) return;
$user->notice_count = 0;
$user->update();
$notifyRepo = new NotificationRepo(); $notifyRepo = new NotificationRepo();
$notifyRepo->markAllAsViewed($user->id); $notifyRepo->markAllAsViewed($user->id);