parameter->setDefault(array('pageSize' => $this->options->commentsListSize, 'parentId' => 0, 'ignoreAuthor' => false)); } /** * 执行函数 * * @access public * @return void */ public function execute() { $select = $this->select()->limit($this->parameter->pageSize) ->where('table.comments.status = ?', 'approved') ->order('table.comments.coid', Typecho_Db::SORT_DESC); if ($this->parameter->parentId) { $select->where('cid = ?', $this->parameter->parentId); } if ($this->options->commentsShowCommentOnly) { $select->where('type = ?', 'comment'); } /** 忽略作者评论 */ if ($this->parameter->ignoreAuthor) { $select->where('ownerId <> authorId'); } $this->db->fetchAll($select, array($this, 'push')); } }