Commit c6c05707 by Bagus Pambudi

limit berita terkini dan populer

parent 36565d88
......@@ -47,8 +47,9 @@ class FrontController extends Controller
private function getDataId($setting)
{
$posts = Posts::where('post_status', '1')->orderby('post_date', 'desc')->paginate($setting['post_per_page']);
$resend = Posts::where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
$posthome = Posts::where('post_status', '1')->orderby('post_date', 'desc')->paginate($setting['post_home']);
$resend = Posts::where('post_status', '1')->orderby('post_date', 'desc')->limit(isset($setting['limit_terkini'])?$setting['limit_terkini']:'5')->get();
$hot = Posts::where('post_status', '1')->orderby('viewer', 'desc')->limit(isset($setting['limit_populer'])?$setting['limit_terkini']:'5')->get();
$info = Information::where('info_status', '1')->where('event_date', '>=', date('Y-m-d'))->orderby('event_date', 'asc')->get();
$agenda = Agenda::where('info_status', '1')->where('event_date', '>=', date('Y-m-d'))->orderby('event_date', 'asc')->get();
$slider = Slider::where('is_active', '1')->orderby('created_at', 'desc')->get();
......@@ -62,6 +63,7 @@ class FrontController extends Controller
$data = [
'posts' => $posts,
'posthome' => $posthome,
'resend' => $resend,
'hot' => $hot,
'info' => $info,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment