belongsTo(Notice::class, 'notice_id', 'id'); } public function user() { return $this->belongsTo(\app\model\user\User::class, 'uid', 'uid'); } public function markAsRead(): bool { if ($this->is_read) { return true; } $this->is_read = 1; $this->read_at = time(); return (bool) $this->save(); } }