From 5f0c1c8b97f58738d64d90e09d9ca26ce8ef53b3 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Mon, 29 Sep 2025 11:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/application/chukebao/controller/NoticeController.php | 6 +++--- Server/application/command/KfNoticeCommand.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/application/chukebao/controller/NoticeController.php b/Server/application/chukebao/controller/NoticeController.php index d7216c7f..b34a9ed6 100644 --- a/Server/application/chukebao/controller/NoticeController.php +++ b/Server/application/chukebao/controller/NoticeController.php @@ -37,20 +37,19 @@ class NoticeController extends BaseController foreach ($list as $k => &$v) { - if ($v['type'] == 1) { $friendId = ToDo::where(['id' => $v['bindId']])->value('friendId'); } elseif ($v['type'] == 2) { $friendId = FollowUp::where(['id' => $v['bindId']])->value('friendId'); } - if (!empty($friendId)) { $friend = Db::table('s2_wechat_friend')->where(['id' => $friendId])->field('nickname,avatar')->find(); } else { $friend = ['nickname' => '', 'avatar' => '']; } - $v['friendData'] = $friend; + + $v['readTime'] = !empty($v['readTime']) ? date('Y-m-d H:i:s', $v['readTime']) : ''; } unset($v); return ResponseHelper::success(['list' => $list, 'total' => $total]); @@ -100,6 +99,7 @@ class NoticeController extends BaseController if (empty($noticeData)) { return ResponseHelper::error('暂未有新消息'); } + NoticeModel::where(['userId' => $userId, 'companyId' => $companyId, 'isRead' => 0])->update(['isRead' => 1, 'readTime' => time()]); FollowUp::where(['userId' => $userId, 'companyId' => $companyId, 'isProcess' => 0])->update(['isProcess' => 1, 'updateTime' => time()]); ToDo::where(['userId' => $userId, 'companyId' => $companyId, 'isProcess' => 0])->update(['isProcess' => 1, 'updateTime' => time()]); Db::commit(); diff --git a/Server/application/command/KfNoticeCommand.php b/Server/application/command/KfNoticeCommand.php index cfc30601..0aeaab91 100644 --- a/Server/application/command/KfNoticeCommand.php +++ b/Server/application/command/KfNoticeCommand.php @@ -40,7 +40,7 @@ class KfNoticeCommand extends Command $followUp = FollowUp::where($where)->alias('a') ->field('a.*,f.nickname,f.avatar,f.alias,f.wechatId') ->join(['s2_wechat_friend f'], 'a.friendId = f.id') - ->where('isRemind',0) + ->where('a.isRemind',0) ->select(); if (!empty($followUp)) { foreach ($followUp as $k => $v) { @@ -81,7 +81,7 @@ class KfNoticeCommand extends Command $toDo = ToDo::where($where)->alias('a') ->field('a.*,f.nickname,f.avatar,f.alias,f.wechatId') ->join(['s2_wechat_friend f'], 'a.friendId = f.id') - ->where('isRemind',0) + ->where('a.isRemind',0) ->select(); if (!empty($toDo)) { foreach ($toDo as $k => $v) {