summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Http/Controllers/CinemaController.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Http/Controllers/CinemaController.php b/app/Http/Controllers/CinemaController.php
index 8a9bb0e..d8adefa 100644
--- a/app/Http/Controllers/CinemaController.php
+++ b/app/Http/Controllers/CinemaController.php
@@ -94,12 +94,29 @@ class CinemaController extends Controller
$directors = $casts->where('profession', 'director');
$screenwriters = $casts->where('profession', 'screenwriter')->take(3);
+ $hnStories = DB::connection('cinema')
+ ->table('links')
+ ->join('story', 'story.id', '=', 'links.story_id')
+ ->select(
+ 'story.story_id',
+ 'story.title',
+ 'story.score',
+ 'story.descendants',
+ 'story.time'
+ )
+ ->where('links.host', 'www.imdb.com')
+ ->where('links.field', 1)
+ ->where('links.param', $id)
+ ->orderBy('story.time', 'desc')
+ ->get();
+
return view('cinema_show', [
'movie' => $movie,
'genres' => $genres,
'actors' => $actors,
'directors' => $directors,
'screenwriters' => $screenwriters,
+ 'hnStories' => $hnStories,
]);
}