{'id'})) return false; $read_num = NoticeRead::where('n_id', $this->{'id'})->where('member_id', $m_id)->count(); return $read_num>0?1:0; } /** * 添加阅读信息 * @param $m_id * @return int|mixed */ function setRead($m_id) { if (empty($this->{'id'})) return 0; $read_num = NoticeRead::where('n_id', $this->{'id'})->where('member_id', $m_id)->count(); if ($read_num > 0) { return 0; } $read = NoticeRead::create(['member_id' => $m_id, 'n_id' => $this->{'id'}]); return $read->{'id'}; } }