diff --git a/widget/HotPost.php b/widget/HotPost.php index 5a50e06..8e7064b 100644 --- a/widget/HotPost.php +++ b/widget/HotPost.php @@ -15,27 +15,9 @@ class HotPost extends Recent */ public function execute() { - $this->parameter->setDefault(['pageSize' => 7]); - $this->db->fetchAll($this->select( - 'table.contents.cid', - 'table.contents.title', - 'table.contents.slug', - 'table.contents.created', - 'table.contents.modified', - 'table.contents.text', - 'table.contents.type', - 'table.contents.status', - 'table.contents.commentsNum', - 'table.contents.allowComment', - 'table.contents.allowPing', - 'table.contents.allowFeed', - 'table.contents.template', - 'table.contents.password', - 'table.contents.authorId', - 'table.contents.parent', - ) + $this->db->fetchAll($this->select() ->where('table.contents.status = ?', 'publish') ->where('table.contents.created < ?', $this->options->time) ->where('table.contents.type = ?', 'post') diff --git a/widget/TopUpContent.php b/widget/TopUpContent.php index b6d3a74..d96cea8 100644 --- a/widget/TopUpContent.php +++ b/widget/TopUpContent.php @@ -17,24 +17,7 @@ public function execute() { $this->parameter->setDefault(['pageSize' => 7]); - $this->db->fetchAll($this->select( - 'table.contents.cid', - 'table.contents.title', - 'table.contents.slug', - 'table.contents.created', - 'table.contents.modified', - 'table.contents.text', - 'table.contents.type', - 'table.contents.status', - 'table.contents.commentsNum', - 'table.contents.allowComment', - 'table.contents.allowPing', - 'table.contents.allowFeed', - 'table.contents.template', - 'table.contents.password', - 'table.contents.authorId', - 'table.contents.parent', - ) + $this->db->fetchAll($this->select() ->join('table.fields', 'table.contents.cid=table.fields.cid') ->where('table.fields.name = ?', 'topUp') ->where('table.fields.str_value = ?', '1')