first commit

This commit is contained in:
ericli1018
2024-03-13 10:43:39 +08:00
commit 1caae33c43
677 changed files with 105611 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function index()
{
$carouselRows = \App\Models\HomeCarousel::where('is_front_show', '=', true)
->orderBy('lft', 'asc')
->orderBy('id', 'desc');
$newsRows = \App\Models\News::where('is_front_show', '=', true)
->orderBy('post_at', 'desc')
->take('3');
$eventRows = \App\Models\News::where('is_front_show', '=', true)
->orderBy('post_at', 'desc')
->take('3');
return view('home', [
'carouselRows' => $carouselRows->get(),
'newsRows' => $newsRows->get(),
'eventRows' => $eventRows->get(),
]);
}
}