main
liutk 2024-06-19 16:15:29 +08:00
parent 5a74edfcdf
commit c60f6fe5e6
3 changed files with 3 additions and 3 deletions

View File

@ -12,10 +12,10 @@ class IndexController extends Controller
public function index() public function index()
{ {
$banners = Ad::where('address', 'index-top')->show()->sort()->get(); $banners = Ad::where('address', 'index-top')->show()->sort()->get();
$examples = Article::where('category', 'examples')->show()->recommend()->sort()->limit(10)->get(); $examples = Article::where('category', 'examples')->show()->recommend()->sort()->limit(10)->get();
$news = Article::where('category', 'news')->show()->recommend()->sort()->get(); $news = Article::where('category', 'news')->show()->recommend()->sort()->get();
$company = settings()->get('company', ''); $company = settings()->get('company', '');
return view('index',compact('banners', 'examples', 'news', 'company')); return view('index',compact('banners', 'examples', 'news', 'company'));
} }

View File

@ -26,7 +26,7 @@ class AdService extends BaseService
$columns = $this->getTableColumns(); $columns = $this->getTableColumns();
$model = $this->getModel(); $model = $this->getModel();
$isEnable = Arr::get($data, 'is_enabled'); $isEnable = Arr::get($data, 'is_enable');
$publishedAt = Arr::get($data, 'published_at'); $publishedAt = Arr::get($data, 'published_at');
if ($isEnable && empty($publishedAt)) { if ($isEnable && empty($publishedAt)) {
$data['published_at'] = now(); $data['published_at'] = now();

View File

@ -75,7 +75,7 @@
<div class="right"> <div class="right">
<p class="title">公司介绍</p> <p class="title">公司介绍</p>
<div class="cont"> <div class="cont">
{{$company}} {!! $company !!}
</div> </div>
<a href="/company">更多</a> <a href="/company">更多</a>
</div> </div>