Merge pull request 'マイページお知らせ修正' (#28) from main_higashide into main
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 21s

Reviewed-on: #28
This commit is contained in:
y.higashide 2025-09-25 14:12:03 +09:00
commit bbc7ae7e83
2 changed files with 12 additions and 7 deletions

View File

@ -79,11 +79,11 @@ class MypageController extends Controller
->get(); ->get();
// お知らせ情報を取得 // お知らせ情報を取得
$informations= DB::table('user_information_history') $information = DB::table('user_information_history')
->where('user_id', $user_id) ->where('user_id', $user_id)
->orderBy('user_information_history_id', 'desc') ->orderBy('user_information_history_id', 'desc')
->limit(3) ->select('entry_date', 'user_information_history')
->get(); ->first();
\Log::info('マイページにアクセス', [ \Log::info('マイページにアクセス', [
'user_id' => $user_id, 'user_id' => $user_id,
@ -94,7 +94,7 @@ class MypageController extends Controller
'user_name' => $user->user_name, // ユーザー名(ヘッダー用) 'user_name' => $user->user_name, // ユーザー名(ヘッダー用)
'contracts' => $contracts, 'contracts' => $contracts,
'seals' => $seals, 'seals' => $seals,
'informations' => $informations 'information' => $information
]); ]);
} }
} }

View File

@ -243,9 +243,14 @@
</h5> </h5>
</div> </div>
<ul class="info-slider_1-1"> <ul class="info-slider_1-1">
@foreach($informations as $information) @if($information)
<li><span class="small" style="margin-right: 1em;">{{ $information->entry_date }}</span>{{ $information->user_information_history }}</li> <li>
@endforeach <span class="small" style="margin-right: 1em;">{{ $information->entry_date }}</span>
{{ $information->user_information_history }}
</li>
@else
<li class="text-center">お知らせはありません。</li>
@endif
</ul> </ul>
</div> </div>
</div> </div>