Commit 50750dcf by Bagus Pambudi

posthome front controller

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