firstpush

This commit is contained in:
2020-09-09 13:38:03 +08:00
parent 38a7861abb
commit 9c6d4da51e
719 changed files with 167902 additions and 25 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Http\Controllers;
use App\Models\Advert;
use App\Models\Article;
use App\Models\Category;
use App\Models\Link;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\View;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
//顶部分类
$categorys = Category::where('parent_id', 0)
->where('status', 1)
->where('top_show', 1)
->select('id', 'title', 'type', 'order', 'article_id')
->orderBy('order', 'asc')
->get();
$links = Link::get();
View::share('all_categorys', $categorys);
View::share('links', $links);
}
}