From 94d3f6c7c8c392b85b73bb4d4a37d96060275f34 Mon Sep 17 00:00:00 2001 From: kyoya0819 Date: Fri, 30 Aug 2024 07:45:04 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=89AP?= =?UTF-8?q?I=E3=81=8C=E4=BC=9A=E7=A4=BE=E5=90=8D=E3=82=92=E8=BF=94?= =?UTF-8?q?=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/Api/PressRelease/RecommendController.php | 1 + backend/app/UseCases/PressRelease/ListFilterByViewHistory.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/Http/Controllers/Api/PressRelease/RecommendController.php b/backend/app/Http/Controllers/Api/PressRelease/RecommendController.php index 672e2c8..5a033ee 100644 --- a/backend/app/Http/Controllers/Api/PressRelease/RecommendController.php +++ b/backend/app/Http/Controllers/Api/PressRelease/RecommendController.php @@ -43,6 +43,7 @@ public function __invoke(Request $request): JsonResponse return [ "title" => $press_release->title, "summary" => $press_release->summary, + "company_name" => $press_release->company->name, "url" => route( "press-release.redirect", [ diff --git a/backend/app/UseCases/PressRelease/ListFilterByViewHistory.php b/backend/app/UseCases/PressRelease/ListFilterByViewHistory.php index b661893..8abed58 100644 --- a/backend/app/UseCases/PressRelease/ListFilterByViewHistory.php +++ b/backend/app/UseCases/PressRelease/ListFilterByViewHistory.php @@ -20,7 +20,7 @@ public static function run( int $take = 20 ): Collection { - return PressRelease::when($mode !== "neutral", function ($query) use ($user_id, $mode) { + return PressRelease::with("company")->when($mode !== "neutral", function ($query) use ($user_id, $mode) { $query->whereHas("keywords.view_histories", function ($query) use ($user_id, $mode) { $query->where("user_id", $user_id) ->when($mode === "love", function ($query) {