静态资源

This commit is contained in:
2020-09-16 08:35:46 +08:00
parent 24315e4798
commit ac3b53b163
40 changed files with 8270 additions and 660 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Advert;
use App\Models\Category;
use App\Models\Link;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
@@ -19,19 +20,15 @@ class Controller extends BaseController
{
//顶部分类
$categorys = Category::where('status', 1)
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
->where('top_show', 1)
->orderBy('order', 'desc')
->select('id', 'title')
->get();
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
->where('top_show', 1)
->orderBy('order', 'desc')
->select('id', 'title')
->get();
$links = Link::get();
//地步友情链接
if (url()->current() == route('index.index')) {
$adverts = Advert::where('category_id', 26)->get();
View::share('adverts', $adverts);
}
View::share('all_categorys', $categorys);
View::share('links', $links);
}
}