This commit is contained in:
Renzo 2016-07-30 02:57:59 -05:00
parent bf96cc0e28
commit eb78266bee

View File

@ -570,12 +570,11 @@ class PostController extends ApplicationController
} }
$this->post_params = $this->params()->all(); $this->post_params = $this->params()->all();
$end = time();
$this->start = strtotime('-'.$period); $this->start = strtotime('-'.$period);
$this->set_title('Exploring ' . $this->period_name); $this->set_title('Exploring ' . $this->period_name);
$this->posts = Post::where("status <> 'deleted' AND posts.index_timestamp >= ? AND posts.index_timestamp <= ? ", date('Y-m-d', $this->start), date('Y-m-d', $end))->order("score DESC")->limit(20)->take(); $this->posts = Post::where("status <> 'deleted' AND posts.index_timestamp >= ? AND posts.index_timestamp <= ? ", date('Y-m-d', $this->start), date('Y-m-d H:i:s'))->order("score DESC")->limit(20)->take();
$this->respond_to_list("posts"); $this->respond_to_list("posts");
} }