diff --git a/Application/Sdk/Controller/NoticeController.class.php b/Application/Sdk/Controller/NoticeController.class.php index 392e9c3c..198d94f5 100644 --- a/Application/Sdk/Controller/NoticeController.class.php +++ b/Application/Sdk/Controller/NoticeController.class.php @@ -49,9 +49,11 @@ class NoticeController extends BaseController{ ->order('level desc') ->select(); $notice_read_model = M('notice_read', 'tab_'); + $notice_read = M('notice_read', 'tab_') + ->where(['user_id' => $request['user_id']]) + ->getField('notice_id', true); foreach($notice_list as $key => $value) { - $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; + $notice_list[$key]['read'] = in_array($value['notice_id'],$notice_read)? 1 : 0; } //分享邀请好友平台币奖励数据