belongsTo(Post::class, 'post_id'); } public function getUserAttr() { return Common::getUserInfo($this->getData('user_uid')); } public function getReadUrlAttr() { $model_post = $this->getAttr('post'); $read_url = $model_post->read_url . '#comment-' . $this->getData('id'); return $read_url; } }