Commit 50750dcf by Bagus Pambudi

posthome front controller

parent 079e1efc
......@@ -96,6 +96,7 @@ class FrontController extends Controller
private function getDataEn($setting)
{
$posts = Posts::with(['rEn'])->where('post_status', '1')->orderby('post_date', 'desc')->paginate($setting['post_per_page']);
$posthome = Posts::where('post_status', '1')->orderby('post_date', 'desc')->paginate(isset($setting['post_home'])?$setting['post_home']:'6');
$resend = Posts::with(['rEn'])->where('post_status', '1')->orderby('post_date', 'desc')->limit(isset($setting['limit_terkini'])?$setting['limit_terkini']:'5')->get();
$hot = Posts::with(['rEn'])->where('post_status', '1')->orderby('viewer', 'desc')->limit(isset($setting['limit_populer'])?$setting['limit_populer']:'5')->get();
$info = Information::with(['rEn'])->where('info_status', '1')->where('event_date', '>=', date('Y-m-d'))->orderby('event_date', 'asc')->get();
......@@ -111,6 +112,7 @@ class FrontController extends Controller
$data = [
'posts' => $posts,
'posthome' => $posthome,
'resend' => $resend,
'hot' => $hot,
'info' => $info,
......@@ -132,6 +134,7 @@ class FrontController extends Controller
private function getDataDe($setting)
{
$posts = Posts::with(['rDe'])->where('post_status', '1')->orderby('post_date', 'desc')->paginate($setting['post_per_page']);
$posthome = Posts::where('post_status', '1')->orderby('post_date', 'desc')->paginate(isset($setting['post_home'])?$setting['post_home']:'6');
$resend = Posts::with(['rDe'])->where('post_status', '1')->orderby('post_date', 'desc')->limit(isset($setting['limit_terkini'])?$setting['limit_terkini']:'5')->get();
$hot = Posts::with(['rDe'])->where('post_status', '1')->orderby('viewer', 'desc')->limit(isset($setting['limit_populer'])?$setting['limit_populer']:'5')->get();
$info = Information::with(['rDe'])->where('info_status', '1')->where('event_date', '>=', date('Y-m-d'))->orderby('event_date', 'asc')->get();
......@@ -147,6 +150,7 @@ class FrontController extends Controller
$data = [
'posts' => $posts,
'posthome' => $posthome,
'resend' => $resend,
'hot' => $hot,
'info' => $info,
......@@ -168,6 +172,7 @@ class FrontController extends Controller
private function getDataSa($setting)
{
$posts = Posts::with(['rSa'])->where('post_status', '1')->orderby('post_date', 'desc')->paginate($setting['post_per_page']);
$posthome = Posts::where('post_status', '1')->orderby('post_date', 'desc')->paginate(isset($setting['post_home'])?$setting['post_home']:'6');
$resend = Posts::with(['rSa'])->where('post_status', '1')->orderby('post_date', 'desc')->limit(isset($setting['limit_terkini'])?$setting['limit_terkini']:'5')->get();
$hot = Posts::with(['rSa'])->where('post_status', '1')->orderby('viewer', 'desc')->limit(isset($setting['limit_populer'])?$setting['limit_populer']:'5')->get();
$info = Information::with(['rSa'])->where('info_status', '1')->where('event_date', '>=', date('Y-m-d'))->orderby('event_date', 'asc')->get();
......@@ -183,6 +188,7 @@ class FrontController extends Controller
$data = [
'posts' => $posts,
'posthome' => $posthome,
'resend' => $resend,
'hot' => $hot,
'info' => $info,
......@@ -204,6 +210,7 @@ class FrontController extends Controller
private function getDataZh($setting)
{
$posts = Posts::with(['rZh'])->where('post_status', '1')->orderby('post_date', 'desc')->paginate($setting['post_per_page']);
$posthome = Posts::where('post_status', '1')->orderby('post_date', 'desc')->paginate(isset($setting['post_home'])?$setting['post_home']:'6');
$resend = Posts::with(['rZh'])->where('post_status', '1')->orderby('post_date', 'desc')->limit(isset($setting['limit_terkini'])?$setting['limit_terkini']:'5')->get();
$hot = Posts::with(['rZh'])->where('post_status', '1')->orderby('viewer', 'desc')->limit(isset($setting['limit_populer'])?$setting['limit_populer']:'5')->get();
$info = Information::with(['rZh'])->where('info_status', '1')->where('event_date', '>=', date('Y-m-d'))->orderby('event_date', 'asc')->get();
......@@ -219,6 +226,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