|
@@ -305,6 +305,9 @@ class ApiController extends Controller
|
|
$item->url = url($item->content);
|
|
$item->url = url($item->content);
|
|
}
|
|
}
|
|
$article_list = Content::where('type', 4)->orderBy('sort')->offset($article_offset)->limit(15)->get();
|
|
$article_list = Content::where('type', 4)->orderBy('sort')->offset($article_offset)->limit(15)->get();
|
|
|
|
+ foreach($article_list as $item) {
|
|
|
|
+ $item->pulish_date = substr($item->updated_at, 0, 10);
|
|
|
|
+ }
|
|
return response()->json(['status' => 'success', 'video_list' => $video_list, 'article_list' => $article_list, 'type' => $request->input('type')]);
|
|
return response()->json(['status' => 'success', 'video_list' => $video_list, 'article_list' => $article_list, 'type' => $request->input('type')]);
|
|
} else if($request->input('type') == 'video') {
|
|
} else if($request->input('type') == 'video') {
|
|
$list = Content::where('type', 3)->orderBy('sort')->offset($video_offset)->limit(15)->get();
|
|
$list = Content::where('type', 3)->orderBy('sort')->offset($video_offset)->limit(15)->get();
|
|
@@ -318,10 +321,9 @@ class ApiController extends Controller
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
$list = Content::where('type', 4)->orderBy('sort')->offset($article_offset)->limit(15)->get();
|
|
$list = Content::where('type', 4)->orderBy('sort')->offset($article_offset)->limit(15)->get();
|
|
- }
|
|
|
|
-
|
|
|
|
- foreach($list as $item) {
|
|
|
|
- $item->publish_date = substr($item->created_at, 0, 10);
|
|
|
|
|
|
+ foreach($list as $item) {
|
|
|
|
+ $item->pulish_date = substr($item->updated_at, 0, 10);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return response()->json(['status' => 'success', 'list' => $list, 'type' => $request->input('type')]);
|
|
return response()->json(['status' => 'success', 'list' => $list, 'type' => $request->input('type')]);
|