详情的未读消息数

master
Your Name 5 years ago
parent 30d970fb39
commit b9b6598df1

@ -170,12 +170,12 @@ class NoticeController extends BaseController{
//获取公告未读条数
$time = time();
$notice = M('notice', 'tab_')->where('start_time < ' . $time . ' AND game_id = ' . $user['game_id']. ' AND (end_time = 0 OR end_time >' . $time . ')')->getField('id',true);
$notice = M('notice', 'tab_')->where('start_time < ' . $time . ' AND game_id = ' . $request['game_id']. ' AND (end_time = 0 OR end_time >' . $time . ')')->getField('id',true);
if(!empty($notice))
{
$data['unread_count'] += count($notice);
$where['notice_id'] = ['in', implode(',', $notice)];
$where['user_id'] = $user['user_id'];
$where['user_id'] = $request['user_id'];
$where['is_read'] = 1;
$notice_read_count = M('notice_read', 'tab_')->where($where)->count();
$data['unread_count'] -= $notice_read_count;

Loading…
Cancel
Save