From 7caa21045c268dc1a7c7e6f7a07da63d6ff9974c Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 1 Nov 2019 14:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E6=98=AF=E5=90=A6=E9=98=85?= =?UTF-8?q?=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/NoticeController.class.php | 5 +++-- Application/Sdk/Controller/UserController.class.php | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Application/Sdk/Controller/NoticeController.class.php b/Application/Sdk/Controller/NoticeController.class.php index c552830d..392e9c3c 100644 --- a/Application/Sdk/Controller/NoticeController.class.php +++ b/Application/Sdk/Controller/NoticeController.class.php @@ -48,9 +48,10 @@ class NoticeController extends BaseController{ ->where($map) ->order('level desc') ->select(); - + $notice_read_model = M('notice_read', 'tab_'); foreach($notice_list as $key => $value) { - $notice_list[$key]['read'] = 1; + $notice_read = $notice_read_model->where(['notice_id' => $value['notice_id'], 'user_id' => $request['user_id']])->find(); + $notice_list[$key]['read'] = empty($notice_read)?0:1; } //分享邀请好友平台币奖励数据 diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index 7a0d9022..2267f522 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -1489,10 +1489,10 @@ class UserController extends BaseController $notice_read_count = M('notice_read', 'tab_')->where($where)->count(); $unread_count -= $notice_read_count; } - // //邀请奖励消息未读条数 - // $unread_count += M('share_record', 'tab_') -> where(['invite_id' => $data['id'], 'award_coin' => ['gt', 0], 'read' => 0]) -> count(); - // //积分奖励消息条数 - // $unread_count += M('point_record', 'tab_') -> where(['type_id' => 6, 'user_id' => $data['id'], 'point' => ['gt', 0], 'read' => 0]) -> count(); + //邀请奖励消息未读条数 + $unread_count += M('share_record', 'tab_') -> where(['invite_id' => $data['id'], 'award_coin' => ['gt', 0], 'read' => 0]) -> count(); + //积分奖励消息条数 + $unread_count += M('point_record', 'tab_') -> where(['type_id' => 6, 'user_id' => $data['id'], 'point' => ['gt', 0], 'read' => 0]) -> count(); $data['notice_count'] = $unread_count; $buddies_request = get_buddies_unagree_count($data['id']); $data['request_count'] = $buddies_request;