Compare commits
22 Commits
e188a9a3f2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 1eb8a751d9 | |||
| fe4affff89 | |||
| 1760549519 | |||
| fcff01bb96 | |||
| c06afebacb | |||
| 2b168d04a6 | |||
| e7dabc7569 | |||
| 4751739f3c | |||
| a1e2085bcb | |||
| c4536a7454 | |||
| 87d4cb4326 | |||
| 74f982b06f | |||
| 4328cd3624 | |||
| 03bd00c545 | |||
| 5627764b9d | |||
| 977dd11c7d | |||
| e2699b7e04 | |||
| 10f551ee19 | |||
| a58ed43f97 | |||
| 85bb2837a7 | |||
| b11045742c | |||
| b3936085a1 |
@@ -17,6 +17,7 @@ class IndexController extends AdminController
|
||||
{
|
||||
$grid = new Grid(new Advert);
|
||||
|
||||
$grid->model()->latest();
|
||||
$grid->actions(function ($actions) {
|
||||
$actions->disableView();
|
||||
});
|
||||
@@ -37,6 +38,7 @@ class IndexController extends AdminController
|
||||
$grid->column('title', '图片名称');
|
||||
// $grid->column('url', '地址')->width(80);
|
||||
$grid->column('sort', '排序');
|
||||
$grid->column('created_at','添加时间');
|
||||
|
||||
return $grid;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Admin\Controllers\Article;
|
||||
|
||||
use App\Admin\Selectable\CategorySelectAble;
|
||||
use App\Models\Article;
|
||||
use App\Models\Category;
|
||||
use Encore\Admin\Controllers\AdminController;
|
||||
@@ -21,7 +22,7 @@ class IndexController extends AdminController
|
||||
$grid->filter(function ($filter) {
|
||||
$filter->column(1 / 2, function ($filter) {
|
||||
$filter->like('title', '文章标题');
|
||||
$filter->equal('category.id', '所属分类')->select(Category::selectOptions(function ($model) {
|
||||
$filter->equal('categories.id', '所属分类')->select(Category::selectOptions(function ($model) {
|
||||
return $model->where('status', 1)->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW]);
|
||||
}, '所有分类'));
|
||||
});
|
||||
@@ -35,7 +36,9 @@ class IndexController extends AdminController
|
||||
|
||||
$grid->column('id', '#ID#');
|
||||
$grid->column('cover', '封面图片')->image('', 100);
|
||||
$grid->column('category.title', '所属分类');
|
||||
$grid->column('所属分类')->display(function () {
|
||||
return $this->categories()->pluck('title');
|
||||
})->label();
|
||||
$grid->column('title', '文章标题');
|
||||
$grid->column('sort', '序号');
|
||||
$grid->status('状态')->switch([
|
||||
@@ -52,23 +55,15 @@ class IndexController extends AdminController
|
||||
$form = new Form(new Article);
|
||||
|
||||
$form->text('title', '文章标题')->rules('min:2');
|
||||
$form->select('category_id', '所属分类')
|
||||
->options(Category::selectOptions(function ($model) {
|
||||
return $model->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW]);
|
||||
}, '选择分类'))
|
||||
->when('in', [3, 29], function (Form $form) {
|
||||
$form->text('working', '工龄');
|
||||
$form->text('job', '岗位');
|
||||
})
|
||||
->rules('required|min:1', [
|
||||
'required' => '必须选择所属分类',
|
||||
'min' => '必须选择所属分类',
|
||||
]);
|
||||
|
||||
$form->belongsToMany('categories', CategorySelectAble::class, __('关联分类'));
|
||||
|
||||
// $form->text('keywords', '关键词')->rules('nullable');
|
||||
$form->text('job', '岗位');
|
||||
$form->text('working', '工龄');
|
||||
$form->textarea('description', '内容简介')->rules('max:350');
|
||||
$form->image('cover', '封面')
|
||||
->move('images/' . date('Y/m/d'))
|
||||
->move('images/'.date('Y/m/d'))
|
||||
->removable()
|
||||
->uniqueName();
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class IndexController extends AdminController
|
||||
->when('show', function (WidgetsForm $form) {
|
||||
$form->select('article_id', '关联文章')
|
||||
->options(function ($option, $info) {
|
||||
return Article::whereHas('category', function ($q) {
|
||||
return Article::whereHas('categories', function ($q) {
|
||||
$q->where('type', 'show');
|
||||
})->pluck('title', 'id');
|
||||
})->help('当分类类型是文章详情的时候需要选择关联文章');
|
||||
@@ -107,7 +107,7 @@ class IndexController extends AdminController
|
||||
->when('show', function (Form $form) {
|
||||
$form->select('article_id', '关联文章')
|
||||
->options(function ($option, $info) {
|
||||
return Article::whereHas('category', function ($q) {
|
||||
return Article::whereHas('categories', function ($q) {
|
||||
$q->where('type', 'show');
|
||||
})->pluck('title', 'id');
|
||||
})->help('当分类类型是文章详情的时候需要选择关联文章');
|
||||
|
||||
44
app/Admin/Selectable/CategorySelectAble.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Selectable;
|
||||
|
||||
use App\Models\Category;
|
||||
use Encore\Admin\Grid\Filter;
|
||||
use Encore\Admin\Grid\Selectable;
|
||||
|
||||
class CategorySelectAble extends Selectable
|
||||
{
|
||||
|
||||
public $model = Category::class;
|
||||
|
||||
public static function display()
|
||||
{
|
||||
return function ($value) {
|
||||
if (is_array($value)) {
|
||||
return implode(';', array_column($value, 'title'));
|
||||
}
|
||||
|
||||
return optional($this->categories)->title;
|
||||
};
|
||||
}
|
||||
|
||||
public function make()
|
||||
{
|
||||
$this->model()->where('status', 1);
|
||||
|
||||
$this->column('id', 'ID');
|
||||
$this->column('title', '分类名称');
|
||||
$this->column('type', '类型')->using(Category::TYPES);
|
||||
|
||||
$this->filter(function (Filter $filter) {
|
||||
$filter->like('title', '分类名称');
|
||||
$filter->equal('parent.id', '所属分类')
|
||||
->select(Category::selectOptions(function ($model) {
|
||||
return $model->where('status', 1)
|
||||
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW]);
|
||||
}, '所有分类'));
|
||||
$filter->equal('type', '类型')->select(Category::TYPES);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Support\Arr;
|
||||
|
||||
/**
|
||||
* Notes: 获取一个分类
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date : 2021/2/3 16:36
|
||||
* @param $categoryId
|
||||
@@ -32,6 +33,7 @@ function getOneCategory($categoryId, $return = '')
|
||||
|
||||
/**
|
||||
* Notes: 获取文章分类详情
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date : 2020/9/10 13:21
|
||||
* @param $categoryId
|
||||
@@ -40,7 +42,8 @@ function getOneCategory($categoryId, $return = '')
|
||||
*/
|
||||
function getOneArticleBYCate($categoryId, $result = '')
|
||||
{
|
||||
$info = Article::where('category_id', $categoryId)
|
||||
$info = Article::where('status', 1)
|
||||
->ByCategory($categoryId)
|
||||
->latest('sort')
|
||||
->latest()
|
||||
->first();
|
||||
@@ -60,6 +63,7 @@ function getOneArticleBYCate($categoryId, $result = '')
|
||||
|
||||
/**
|
||||
* Notes: 获取分类下的文章
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date : 2020/9/10 10:05
|
||||
* @param $categoryId
|
||||
@@ -68,8 +72,8 @@ function getOneArticleBYCate($categoryId, $result = '')
|
||||
*/
|
||||
function getArticlesBYCate($categoryId, $take)
|
||||
{
|
||||
$articles = Article::where('category_id', $categoryId)
|
||||
->where('status', 1)
|
||||
$articles = Article::where('status', 1)
|
||||
->ByCategory($categoryId)
|
||||
->latest('sort')
|
||||
->latest()
|
||||
->take($take)
|
||||
@@ -99,6 +103,28 @@ function getTopCate($categoryId)
|
||||
return $parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 获取所有下级
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date: 2022/8/19 17:24
|
||||
* @param $array
|
||||
* @param $categoryId
|
||||
* @return array
|
||||
*/
|
||||
function getAllChild($categories, $categoryId)
|
||||
{
|
||||
$arr = array();
|
||||
foreach ($categories as $category) {
|
||||
if ($category['parent_id'] == $categoryId) {
|
||||
$arr[] = $category['id'];
|
||||
$arr = array_merge($arr, getAllChild($categories, $category['id']));
|
||||
};
|
||||
};
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
//获取专利和论文
|
||||
function getPatent($take, $type = '')
|
||||
{
|
||||
@@ -150,6 +176,7 @@ function getCate($id, $value = '')
|
||||
|
||||
/**
|
||||
* Notes: 获取所有上级
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date : 2021/2/3 13:22
|
||||
* @param $categoryId
|
||||
@@ -172,6 +199,7 @@ function getAllParentCate($categoryId): array
|
||||
|
||||
/**
|
||||
* Notes: 获得分类
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date : 2021/2/3 16:38
|
||||
* @param $cate_id
|
||||
@@ -186,8 +214,9 @@ function getArtilesByCates($cate_id, $take = 8)
|
||||
->pluck('id')
|
||||
->toArray();
|
||||
|
||||
return Article::whereIn('category_id', $cate_ids)
|
||||
return Article::where('status', 1)
|
||||
->latest()
|
||||
->ByCategory($cate_ids)
|
||||
->take($take)
|
||||
->get();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ class ArticleController extends Controller
|
||||
//文章列表
|
||||
public function index(Category $category)
|
||||
{
|
||||
$articles = Article::where('category_id', $category->id)
|
||||
$articles = Article::ByCategory($category->id)
|
||||
->where('status', 1)
|
||||
->orderBy('created_at', 'desc')
|
||||
->paginate(5);
|
||||
|
||||
@@ -26,15 +27,12 @@ class ArticleController extends Controller
|
||||
return redirect($article->url);
|
||||
}
|
||||
|
||||
$category = $article->category;
|
||||
|
||||
$next = Article::where('id', '>', $article->id)
|
||||
->where('category_id', $category->id)
|
||||
->ByCategory($article->categories()->pluck('id'))
|
||||
->where('status', 1)
|
||||
->first();
|
||||
$parent = getTopCate($category->id);
|
||||
|
||||
return view('articles.show', compact('article', 'category', 'next', 'parent'));
|
||||
return view('articles.show', compact('article', 'next'));
|
||||
}
|
||||
|
||||
//搜索
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,8 @@ class CategoryController extends Controller
|
||||
$parent = getTopCate($category->id);
|
||||
|
||||
$template = array_flip(config('haai.category'));
|
||||
if (isset($template[$category->id]) && !in_array($category->id, config('haai.no_list'))) {
|
||||
return view('category.' . $template[$category->id], compact('category', 'parent'));
|
||||
if (isset($template[$category->id]) && ! in_array($category->id, config('haai.no_list'))) {
|
||||
return view('category.'.$template[$category->id], compact('category', 'parent'));
|
||||
}
|
||||
|
||||
return redirect(route('category.list', $category));
|
||||
@@ -38,15 +38,21 @@ class CategoryController extends Controller
|
||||
$template = 'category.persons';
|
||||
}
|
||||
|
||||
if ($category->id == 74) {
|
||||
$categories = Category::get();
|
||||
$cate_ids = array_merge([$category->id], getAllChild($categories, $category->id));
|
||||
} else {
|
||||
$cate_ids = Category::where('parent_id', $category->id)
|
||||
->orWhere('id', $category->id)
|
||||
->where('status', 1)
|
||||
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
|
||||
->pluck('id')
|
||||
->toArray();
|
||||
}
|
||||
|
||||
$articles = Article::whereIn('category_id', $cate_ids)
|
||||
->where('status', 1)
|
||||
|
||||
$articles = Article::where('status', 1)
|
||||
->ByCategory($cate_ids)
|
||||
->latest('sort')
|
||||
->latest()
|
||||
->paginate($take);
|
||||
@@ -57,6 +63,10 @@ class CategoryController extends Controller
|
||||
$parent = $category->parent;
|
||||
}
|
||||
|
||||
if ($category->children->isEmpty()) {
|
||||
$parent = $category->parent;
|
||||
}
|
||||
|
||||
return view($template, compact('category', 'parent', 'articles'));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,22 +13,29 @@ class IndexController extends Controller
|
||||
|
||||
/**
|
||||
* Notes: 首页
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date : 2020/6/1 9:11
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
'ysxw' => Article::where('category_id', 15)->latest('sort')->latest()->take(8)->get(),
|
||||
'ysxw' => Article::ByCategory(15)
|
||||
->where('status', 1)
|
||||
->latest('sort')
|
||||
->latest()
|
||||
->take(8)
|
||||
->get(),
|
||||
// 'kjcg' => Article::where('category_id', 19)->latest('sort')->latest()->take(8)->get(),
|
||||
// 'lwzl' => Patent::latest('sort')->latest()->take(11)->get(),
|
||||
'center_advert' => Advert::latest('sort')->latest()->where('category_id', 23)->take(3)->get(),
|
||||
'ysxw_right_advert' => Advert::latest('sort')->latest()->where('category_id', 24)->first(),
|
||||
'kjcg_right_advert' => Advert::latest('sort')->latest()->where('category_id', 25)->take(2)->get(),
|
||||
'lwzl_right_advert' => Advert::latest('sort')->latest()->where('category_id', 27)->take(2)->get(),
|
||||
'pos_a' => Article::where('position', Article::POSITION_A)->first(),
|
||||
'pos_b' => Article::where('position', Article::POSITION_B)->first(),
|
||||
'pos_c' => Article::where('position', Article::POSITION_C)->first(),
|
||||
'xz_right_advert' => Advert::latest('sort')->latest()->where('category_id', 87)->take(2)->get(),
|
||||
'pos_a' => Article::where('position', Article::POSITION_A)->where('status', 1)->first(),
|
||||
'pos_b' => Article::where('position', Article::POSITION_B)->where('status', 1)->first(),
|
||||
'pos_c' => Article::where('position', Article::POSITION_C)->where('status', 1)->first(),
|
||||
];
|
||||
|
||||
return view('index.index', $data);
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Article;
|
||||
use App\Models\ArticleCategory;
|
||||
|
||||
class TestController extends Controller
|
||||
{
|
||||
|
||||
@@ -10,4 +13,20 @@ class TestController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function set_article_category()
|
||||
{
|
||||
$articles = Article::whereHas('category')
|
||||
->chunk(200, function ($articles) {
|
||||
foreach ($articles as $article) {
|
||||
ArticleCategory::create([
|
||||
'article_id' => $article->id,
|
||||
'category_id' => $article->category_id,
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@ namespace App\Models;
|
||||
|
||||
use App\Models\Traits\BelongsToCategory;
|
||||
use App\Models\Traits\HasOneCover;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Article extends Model
|
||||
{
|
||||
|
||||
use HasOneCover, BelongsToCategory;
|
||||
use HasOneCover;
|
||||
|
||||
const POSITION_A = 1;
|
||||
const POSITION_B = 2;
|
||||
@@ -20,9 +21,40 @@ class Article extends Model
|
||||
self::POSITION_C => '科技成果',
|
||||
];
|
||||
|
||||
public function getLinkAttribute()
|
||||
public function getLinkAttribute(): string
|
||||
{
|
||||
return route('article.show', $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 关联分类
|
||||
* @Author: 玄尘
|
||||
* @Date : 2021/4/2 9:11
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function categories(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Category::class)
|
||||
->using(ArticleCategory::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: description
|
||||
* @Author: 玄尘
|
||||
* @Date : 2021/4/2 9:17
|
||||
* @param $query
|
||||
* @param $ids
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeByCategory($query, $ids)
|
||||
{
|
||||
if (!is_array($ids)) {
|
||||
$ids = [$ids];
|
||||
}
|
||||
|
||||
return $query->whereHas('categories', function ($q) use ($ids) {
|
||||
$q->whereIN('id', $ids);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
11
app/Models/ArticleCategory.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class ArticleCategory extends Pivot
|
||||
{
|
||||
|
||||
//
|
||||
}
|
||||
@@ -6,6 +6,7 @@ use App\Models\Traits\HasOneCover;
|
||||
use Encore\Admin\Traits\AdminBuilder;
|
||||
use Encore\Admin\Traits\ModelTree;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Category extends Model
|
||||
@@ -44,7 +45,7 @@ class Category extends Model
|
||||
return $this->hasOne(Article::class, 'id', 'article_id');
|
||||
break;
|
||||
case self::TYPE_ARTICLE:
|
||||
return $this->hasMany(Article::class);
|
||||
return $this->belongsToMany(Article::class);
|
||||
break;
|
||||
case self::TYPE_ADVERT:
|
||||
return $this->hasMany(Advert::class);
|
||||
@@ -64,4 +65,9 @@ class Category extends Model
|
||||
return $this->hasMany(__CLASS__, 'parent_id');
|
||||
}
|
||||
|
||||
public function articles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Article::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ return [
|
||||
'sjljrc' => 69,//省级领军人才梯队
|
||||
'yjzdxk' => 68,//院级重点学科
|
||||
'xhqk' => 66,//院级重点学科
|
||||
'yjsgg' => 74,//预决算公告
|
||||
'gsxxjy' => 75,//党史学习教育
|
||||
],
|
||||
//分类使用的模板
|
||||
'template' => [
|
||||
@@ -20,5 +22,6 @@ return [
|
||||
],
|
||||
'no_list' => [
|
||||
19,
|
||||
74,
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateArticleCategoriesTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('article_category', function (Blueprint $table) {
|
||||
$table->foreignId('article_id');
|
||||
$table->foreignId('category_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('article_categories');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -107,17 +107,29 @@ img {
|
||||
.tool-search button i {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* 网站背景 2023-1-3 */
|
||||
.bg{
|
||||
background: url(../img/bg.png) no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
.mian{
|
||||
background-color: #fff;
|
||||
}
|
||||
/* header */
|
||||
.header{
|
||||
margin-top: 16%;
|
||||
}
|
||||
.header-content {
|
||||
padding: 20px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.header-logo {
|
||||
width: 521px;
|
||||
height: 75px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.header-text {
|
||||
@@ -129,6 +141,7 @@ img {
|
||||
color: #273981;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.header-text-sign {
|
||||
@@ -644,7 +657,7 @@ img {
|
||||
text-align: center;
|
||||
background-color: #4864ae;
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -868,7 +881,7 @@ img {
|
||||
|
||||
.index-mian-right-ads {
|
||||
display: flex;
|
||||
margin: 0 -10px 40px -10px;
|
||||
margin: 0 -10px 33px -10px;
|
||||
}
|
||||
|
||||
.index-mian-right-ad-5 {
|
||||
@@ -888,7 +901,12 @@ img {
|
||||
.index-mian-right-ul li a {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.index-mian-news-ul_media{
|
||||
margin: 8px 0 !important;
|
||||
}
|
||||
.index-mian-news-ul_media a{
|
||||
line-height: 19px !important;
|
||||
}
|
||||
.index-mian-right-video {
|
||||
margin: 20px 0 40px;
|
||||
position: relative;
|
||||
@@ -948,20 +966,21 @@ img {
|
||||
}
|
||||
|
||||
.index-mian-notice-ul li {
|
||||
line-height: 17px;
|
||||
margin: 20px 0;
|
||||
margin: 11px 0;
|
||||
}
|
||||
|
||||
.index-mian-notice-ul li a{
|
||||
position: relative;
|
||||
padding-right: 0;
|
||||
padding-left: 20px;
|
||||
display: -webkit-box;
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
.index-mian-notice-ul li a i{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
top: 4px;
|
||||
}
|
||||
|
||||
/* footer */
|
||||
@@ -977,6 +996,10 @@ img {
|
||||
margin: 10px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
footer p span , footer p a{
|
||||
color: #fff;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.footer img {
|
||||
width: 68px;
|
||||
@@ -1264,6 +1287,10 @@ img {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.new-org-inst-ul li {
|
||||
border-top: dashed 1px #f1f3f8;
|
||||
}
|
||||
|
||||
.org-inst span {
|
||||
line-height: 40px;
|
||||
width: 20%;
|
||||
@@ -1282,12 +1309,12 @@ img {
|
||||
.org-inst-ul {
|
||||
margin-bottom: 20px;
|
||||
padding-left: 10px;
|
||||
border-top: dashed 1px #f1f3f8;
|
||||
}
|
||||
|
||||
.org-inst-ul li {
|
||||
line-height: 50px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.org-inst-ul li span,
|
||||
@@ -1536,16 +1563,23 @@ img {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.rcdw-text-item span{
|
||||
.rcdw-text-item-new p {
|
||||
color: #555;
|
||||
margin-right: 10px;
|
||||
margin-right: 30px;
|
||||
cursor: pointer;
|
||||
width: 48px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.rcdw-text-item span:hover{
|
||||
.rcdw-text-item-new span:hover{
|
||||
color: #273981;
|
||||
}
|
||||
|
||||
.rcdw-text-item-new span{
|
||||
text-align-last: justify;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 人才队伍 - 省领军人才梯队 */
|
||||
.rctd-boeder {
|
||||
border-bottom: 1px solid #eee;
|
||||
@@ -1719,3 +1753,228 @@ img {
|
||||
.laytool-ul li:hover .wechat-code {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.newCont-ul:last-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.newCont-ul:last-child::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: -20px;
|
||||
top: 0;
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.newCont {
|
||||
width: 650px;
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.newCont-ul {
|
||||
width: calc(50% - 20px);
|
||||
margin-left: 20px
|
||||
}
|
||||
|
||||
.newCont-ul a {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.newCont-ul>div {
|
||||
font-size: 18px;
|
||||
margin-bottom: 10px
|
||||
}
|
||||
.mb{
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@media (max-width:768px) {
|
||||
.mb{
|
||||
display: block;
|
||||
background: #273981;
|
||||
width: 30px;
|
||||
border-radius: 4px;
|
||||
margin-right: 20px
|
||||
}
|
||||
.nav{
|
||||
display: none;
|
||||
}
|
||||
.mian-nav{
|
||||
width: 100%;
|
||||
}
|
||||
.bg{
|
||||
background-position: center 35px ;
|
||||
}
|
||||
.tool{
|
||||
height: 35px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.tool-content{
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tool-search input{
|
||||
height: 20px;
|
||||
width: 120px;
|
||||
}
|
||||
.tool-search{
|
||||
margin: 6px 0;
|
||||
}
|
||||
.tool-search button{
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
vertical-align:top;
|
||||
}
|
||||
.tool-herf span{
|
||||
padding: 0 2px;
|
||||
}
|
||||
.tool-herf a, .tool-herf span,.tool-search input{
|
||||
line-height: 35px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.container{
|
||||
width: 100%;
|
||||
}
|
||||
.header{
|
||||
margin-top: 23%;
|
||||
}
|
||||
.header-logo{
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
}
|
||||
.header-content{
|
||||
padding: 0;
|
||||
}
|
||||
.header-text{
|
||||
padding-left: 0;
|
||||
width: 50%;
|
||||
font-size: 12px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.nav-ul{
|
||||
flex-direction: column;
|
||||
}
|
||||
.nav-ul-li > a{
|
||||
font-size: 12px;
|
||||
}
|
||||
.swiper-banner-img{
|
||||
padding-top:12%;
|
||||
background-size:40%;
|
||||
}
|
||||
.swiper-banner-img h3{
|
||||
padding: 10px 10px 30px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.swiper-pagination .swiper-pagination-bullet{
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
.index-mian-left,.index-mian-news-hot, .index-mian-news-hot ~ .index-mian-news-ul,.index-mian-right{
|
||||
width: 100%;
|
||||
}
|
||||
.index-mian-news-hot ~ .index-mian-news-ul{
|
||||
padding: 0 10px 0 20px;
|
||||
}
|
||||
.index-mian-news-cover{
|
||||
padding-top: 67%;
|
||||
}
|
||||
.index-mian-right-video-item{
|
||||
width: 82%;
|
||||
}
|
||||
.index-mian-right-video-item-lg{
|
||||
width: 63%;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.index-mian-right-video{
|
||||
padding-left: 74%;
|
||||
}
|
||||
.newCont{
|
||||
margin-top: 20px;
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.index-mian-notice-ul{
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
/* 院所新闻 */
|
||||
.results-news-ul{
|
||||
margin: 0 20px;
|
||||
}
|
||||
.mian-content{
|
||||
width: 100%;
|
||||
}
|
||||
.href-flex{
|
||||
justify-content: center;
|
||||
}
|
||||
/* 组织机构 */
|
||||
.org-intro,.org-history{
|
||||
padding-top: 230px;
|
||||
padding-left:0;
|
||||
padding-right: 0;
|
||||
margin: 0 20px;
|
||||
}
|
||||
.org-history-cover, .org-intro-cover{
|
||||
width: 100%;
|
||||
}
|
||||
.org-intro-more{
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.org-inst span{
|
||||
width: 30%;
|
||||
}
|
||||
.details{
|
||||
margin: 0 auto;
|
||||
}
|
||||
/* 领导班子 */
|
||||
.org-lead-ul{
|
||||
margin: 0 20px 20px 10px;
|
||||
}
|
||||
.org-lead-ul li{
|
||||
width: 100%;
|
||||
}
|
||||
/* 党建文化 */
|
||||
.results-news-cover span,.results-news-cover{
|
||||
width: 100%;
|
||||
}
|
||||
.results-news-cover ~ .results-news-ul{
|
||||
padding-left: 0;
|
||||
padding-top: 225px;
|
||||
}
|
||||
.results-news-cover span{
|
||||
font-size: 14px;
|
||||
}
|
||||
.sub-title{
|
||||
padding-right: 10px;
|
||||
}
|
||||
/* 人才队伍 */
|
||||
.rctd-boeder:last-child,.rctd-boeder{
|
||||
margin: 0 20px;
|
||||
}
|
||||
.rctd-boeder{
|
||||
padding-left: 0;
|
||||
padding-top: 165px;
|
||||
}
|
||||
.rctd2{
|
||||
width: 100%;
|
||||
}
|
||||
/* 文章详情 */
|
||||
.details-content p video{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.footer p{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
line-height: 30px;
|
||||
}
|
||||
.footer p span , .footer p a{
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
BIN
public/assets/index/img/bg.png
Normal file
|
After Width: | Height: | Size: 692 KiB |
BIN
public/assets/index/img/float_logo.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
public/assets/index/img/index_nav.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 43 KiB |
BIN
public/assets/index/img/z19_ewm3.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
public/assets/index/img/z19_scroll_wx.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
9
resources/views/admin/testlogin/index.blade.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>系统维护中</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align: center;line-height: 200px;margin: 100px auto;font-size: 41px;font-weight: bold;color: #aeaeae;">系统正在维护中......</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -8,9 +8,9 @@
|
||||
<div class="container details">
|
||||
<!-- 文章标题 -->
|
||||
<h3 class="details-title">{{ $article->title }}</h3>
|
||||
@if (in_array($parent->id,config('app.show_time')))
|
||||
{{-- @if (in_array($parent->id,config('app.show_time')))--}}
|
||||
<p class="details-time">{{ $article->created_at }}</p>
|
||||
@endif
|
||||
{{-- @endif--}}
|
||||
<!-- 文章详情 -->
|
||||
<div class="details-content">
|
||||
{{-- <img src="{{ $article->cover_path }}">--}}
|
||||
|
||||
@@ -16,21 +16,21 @@
|
||||
<!-- 高级职称专家 -->
|
||||
<div class="rcdw-text">
|
||||
<!-- 正高 -->
|
||||
<div class="rcdw-text-item">
|
||||
<div class="rcdw-text-item rcdw-text-item-new">
|
||||
<b><i class="fa fa-chevron-circle-right"></i>正高:</b>
|
||||
@if (getArticlesBYCate(64,16)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(64,100) as $article)
|
||||
<span data-href="{{ $article->link }}">{{ $article->title }}</span>
|
||||
<p><span data-href="{{ $article->link }}">{{ $article->title }}</span></p>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<!-- 副高 -->
|
||||
<div class="rcdw-text-item">
|
||||
<div class="rcdw-text-item rcdw-text-item-new">
|
||||
<b><i class="fa fa-chevron-circle-right"></i>副高:</b>
|
||||
@if (getArticlesBYCate(65,16)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(65,100) as $article)
|
||||
<span data-href="{{ $article->link }}">{{ $article->title }}</span>
|
||||
<p><span data-href="{{ $article->link }}">{{ $article->title }}</span></p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
|
||||
35
resources/views/category/gsxxjy.blade.php
Normal file
@@ -0,0 +1,35 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $category->title)
|
||||
|
||||
@section('content')
|
||||
<!-- content -->
|
||||
<div class="container mian">
|
||||
<!-- content-nav -->
|
||||
<nav class="mian-nav">
|
||||
@include('category.left',$parent)
|
||||
</nav>
|
||||
<!-- content-content -->
|
||||
<div class="mian-content">
|
||||
@include('layouts.navigation',['category'=>$category])
|
||||
<!-- 科研领域 -->
|
||||
<ul class="research-award-ul">
|
||||
@foreach (getArticlesBYCate(75,16) as $article)
|
||||
<li data-href="{{ $article->link }}">
|
||||
<span
|
||||
class="research-award-cover"
|
||||
style="background-image: url({{ $article->cover_path }});"
|
||||
></span>
|
||||
<h3 class="research-award-title nowrap-multi"
|
||||
style="line-height: 24px; padding: 15px 0; height: 37px"
|
||||
data-herf="{{ $article->link }}"
|
||||
>{{ $article->title }}</h3>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end content -->
|
||||
@endsection
|
||||
@@ -15,14 +15,17 @@
|
||||
|
||||
<div class="org-inst">
|
||||
<span data-href="{{ getOneCategory(5,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(5,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(6,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(6,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(7,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(7,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(8,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(8,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(9,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(9,'title') }}</span>
|
||||
</div>
|
||||
<ul class="org-inst-ul">
|
||||
<ul class="org-inst-ul new-org-inst-ul" style="margin-bottom: 0; margin-top: 5px;">
|
||||
<li>
|
||||
<span><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(37,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(7,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(7,'title') }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="org-inst-ul new-org-inst-ul">
|
||||
<li>
|
||||
<span data-href="{{ getOneCategory(37,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(37,'title') }}</span>
|
||||
<span><i class="fa fa-chevron-right"></i></span>
|
||||
@if (getCateChild(37)->isNotEmpty())
|
||||
@foreach (getCateChild(37) as $child)
|
||||
@@ -31,7 +34,13 @@
|
||||
@endif
|
||||
</li>
|
||||
<li>
|
||||
<span><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(38,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(41,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(41,'title') }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span data-href="{{ getOneCategory(44,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(44,'title') }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span data-href="{{ getOneCategory(38,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(38,'title') }}</span>
|
||||
<span><i class="fa fa-chevron-right"></i></span>
|
||||
@if (getCateChild(38)->isNotEmpty())
|
||||
@foreach (getCateChild(38) as $child)
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
@else
|
||||
<div class="mian-nav-title">
|
||||
{{ $category->parent->title }}
|
||||
{{ $parent->title }}
|
||||
</div>
|
||||
<ul class="mian-nav-ul">
|
||||
@foreach (getCateChild($category->parent->id) as $children)
|
||||
@foreach (getCateChild($parent->id) as $children)
|
||||
<li class="show">
|
||||
<a href="{{ $children->link }}">{{ $children->title }}</a>
|
||||
</li>
|
||||
|
||||
@@ -19,21 +19,21 @@
|
||||
</div>
|
||||
<div class="rcdw-text">
|
||||
<!-- 正高 -->
|
||||
<div class="rcdw-text-item">
|
||||
<div class="rcdw-text-item rcdw-text-item-new">
|
||||
<b><i class="fa fa-chevron-circle-right"></i>正高:</b>
|
||||
@if (getArticlesBYCate(64,16)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(64,100) as $article)
|
||||
<span data-href="{{ $article->link }}">{{ $article->title }}</span>
|
||||
<p data-href="{{ $article->link }}"><span>{{ $article->title }}</span></p>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<!-- 副高 -->
|
||||
<div class="rcdw-text-item">
|
||||
<div class="rcdw-text-item rcdw-text-item-new">
|
||||
<b><i class="fa fa-chevron-circle-right"></i>副高:</b>
|
||||
@if (getArticlesBYCate(65,16)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(65,100) as $article)
|
||||
<span data-href="{{ $article->link }}">{{ $article->title }}</span>
|
||||
<p data-href="{{ $article->link }}"><span>{{ $article->title }}</span></p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if(getAllTalent(69)->isNotEmpty())
|
||||
@if(getAllTalent(68)->isNotEmpty())
|
||||
|
||||
<div class="sub-title">
|
||||
<b><i class="fa fa-line-chart"></i>{{ getOneCategory(68,'title') }}</b>
|
||||
@@ -79,7 +79,7 @@
|
||||
<div class="rctd-boeder">
|
||||
<div class="rctd2" style="background-image: url({{ $talent->cover_path }});"></div>
|
||||
<p class="rctd3-p">
|
||||
<span>梯队名称:</span>
|
||||
<span>学科名称:</span>
|
||||
<span>{{ $talent->title }}</span>
|
||||
</p>
|
||||
<p class="rctd3-p">
|
||||
@@ -92,7 +92,7 @@
|
||||
</p>
|
||||
|
||||
<p class="rctd3-p">
|
||||
<span>梯队介绍:</span>
|
||||
<span>学科介绍:</span>
|
||||
<span>
|
||||
{{ $talent->description }}
|
||||
</span>
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
<div class="mian-content">
|
||||
@include('layouts.navigation',$category)
|
||||
<!-- 学会期刊 -->
|
||||
<div class="sub-title">
|
||||
<b><i class="fa fa-flag"></i>{{ getOneCategory(66,'title') }}</b>
|
||||
<a href="{{ getOneCategory(66,'link') }}">更多</a>
|
||||
</div>
|
||||
{{-- <div class="sub-title">--}}
|
||||
{{-- <b><i class="fa fa-flag"></i>{{ getOneCategory(66,'title') }}</b>--}}
|
||||
{{-- <a href="{{ getOneCategory(66,'link') }}">更多</a>--}}
|
||||
{{-- </div>--}}
|
||||
<ul class="research-award-ul">
|
||||
@foreach (getArticlesBYCate(66,3) as $article)
|
||||
@foreach (getArtilesByCates(66,3) as $article)
|
||||
<li data-href="{{ $article->link }}">
|
||||
<span class="research-award-cover"
|
||||
style="background-image: url({{ $article->cover_path }});"></span>
|
||||
|
||||
79
resources/views/category/yjsgg.blade.php
Normal file
@@ -0,0 +1,79 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $category->title)
|
||||
|
||||
@section('content')
|
||||
<!-- content -->
|
||||
<div class="container mian">
|
||||
<!-- content-nav -->
|
||||
<nav class="mian-nav">
|
||||
@include('category.left',$parent)
|
||||
</nav>
|
||||
<!-- content-content -->
|
||||
<div class="mian-content">
|
||||
@include('layouts.navigation',['category'=>$category])
|
||||
|
||||
<!-- 创新成果转移转化亮点工作 -->
|
||||
<div class="sub-title">
|
||||
<b><i class="fa fa-certificate"></i>{{ getOneCategory(20,'title') }}</b>
|
||||
<a href="{{ getOneCategory(20,'link') }}">更多</a>
|
||||
</div>
|
||||
<div class="results-news">
|
||||
@if(getArticlesBYCate(20,8)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(20,8) as $article)
|
||||
@if ($loop->first)
|
||||
<a class="results-news-cover" style="background-image: url({{ $article->cover_path }});"
|
||||
href="{{ $article->link }}">
|
||||
<span>{{ $article->title }}</span>
|
||||
</a>
|
||||
@endif
|
||||
@endforeach
|
||||
<ul class="results-news-ul">
|
||||
@foreach (getArticlesBYCate(20,8) as $article)
|
||||
@if ($loop->iteration>1)
|
||||
<li>
|
||||
<a class="nowrap" href="{{ $article->link }}">
|
||||
<i class="fa fa-angle-double-right"></i>
|
||||
{{ $article->title }}
|
||||
<span>{{ $article->created_at->format('Y-m-d') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
<!-- 工作动态 -->
|
||||
<div class="sub-title">
|
||||
<b><i class="fa fa-th-large"></i>{{ getOneCategory(21,'title') }}</b>
|
||||
<a href="{{ getOneCategory(21,'link') }}">更多</a>
|
||||
</div>
|
||||
<div class="results-news">
|
||||
@if(getArticlesBYCate(21,8)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(21,8) as $article)
|
||||
@if ($loop->first)
|
||||
<a class="results-news-cover" style="background-image: url({{ $article->cover_path }});"
|
||||
href="{{ $article->link }}">
|
||||
<span>{{ $article->title }}</span>
|
||||
</a>
|
||||
@endif
|
||||
@endforeach
|
||||
<ul class="results-news-ul">
|
||||
@foreach (getArticlesBYCate(21,8) as $article)
|
||||
@if ($loop->iteration>1)
|
||||
<li>
|
||||
<a class="nowrap" href="{{ $article->link }}">
|
||||
<i class="fa fa-angle-double-right"></i>
|
||||
{{ $article->title }}
|
||||
<span>{{ $article->created_at->format('Y-m-d') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end content -->
|
||||
@endsection
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="rctd-boeder">
|
||||
<div class="rctd2" style="background-image: url({{ $talent->cover_path }});"></div>
|
||||
<p class="rctd3-p">
|
||||
<span>梯队名称:</span>
|
||||
<span>学科名称:</span>
|
||||
<span>{{ $talent->title }}</span>
|
||||
</p>
|
||||
<p class="rctd3-p">
|
||||
@@ -35,7 +35,7 @@
|
||||
</p>
|
||||
|
||||
<p class="rctd3-p">
|
||||
<span>梯队介绍:</span>
|
||||
<span>学科介绍:</span>
|
||||
<span>
|
||||
{{ $talent->description }}
|
||||
</span>
|
||||
|
||||
@@ -51,14 +51,17 @@
|
||||
</div>
|
||||
<div class="org-inst">
|
||||
<span data-href="{{ getOneCategory(5,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(5,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(6,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(6,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(7,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(7,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(8,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(8,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(9,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(9,'title') }}</span>
|
||||
</div>
|
||||
<ul class="org-inst-ul">
|
||||
<ul class="org-inst-ul new-org-inst-ul" style="margin-bottom: 0; margin-top: 5px;">
|
||||
<li>
|
||||
<span><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(37,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(7,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(7,'title') }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="org-inst-ul new-org-inst-ul">
|
||||
<li>
|
||||
<span data-href="{{ getOneCategory(37,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(37,'title') }}</span>
|
||||
<span><i class="fa fa-chevron-right"></i></span>
|
||||
@if (getCateChild(37)->isNotEmpty())
|
||||
@foreach (getCateChild(37) as $child)
|
||||
@@ -67,7 +70,13 @@
|
||||
@endif
|
||||
</li>
|
||||
<li>
|
||||
<span><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(38,'title') }}</span>
|
||||
<span data-href="{{ getOneCategory(41,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(41,'title') }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span data-href="{{ getOneCategory(44,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(44,'title') }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span data-href="{{ getOneCategory(38,'link') }}"><i class="fa fa-chevron-circle-right"></i>{{ getOneCategory(38,'title') }}</span>
|
||||
<span><i class="fa fa-chevron-right"></i></span>
|
||||
@if (getCateChild(38)->isNotEmpty())
|
||||
@foreach (getCateChild(38) as $child)
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
@section('title', '黑龙江省科学院智能制造研究所')
|
||||
|
||||
@section('css')
|
||||
<!-- <style>
|
||||
html {
|
||||
-webkit-filter: grayscale(100%);
|
||||
}
|
||||
</style> -->
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<!-- special -->
|
||||
{{-- <div class="container special-content">--}}
|
||||
@@ -9,7 +17,7 @@
|
||||
{{-- </div>--}}
|
||||
<!-- end special -->
|
||||
<!-- banner -->
|
||||
<div class="swiper-container" id="swiperBanner">
|
||||
<div class="container swiper-container" id="swiperBanner">
|
||||
<div class="swiper-wrapper">
|
||||
@if ($center_advert->isNotEmpty())
|
||||
@foreach ($center_advert as $advert)
|
||||
@@ -84,19 +92,40 @@
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
@if (getArtilesByCates(10)->isNotEmpty())
|
||||
<div class="newCont">
|
||||
@if (getArtilesByCates(14)->isNotEmpty())
|
||||
<div class="newCont-ul">
|
||||
<div style="font-weight: 600">{{ getOneCategory(14,'title') }}</div>
|
||||
<ul class="index-mian-news-ul">
|
||||
@foreach (getArtilesByCates(10) as $info)
|
||||
@foreach (getArtilesByCates(14,6) as $info)
|
||||
<li>
|
||||
<a href="{{ $info->link }}" class="nowrap">
|
||||
<i class="fa fa-chevron-circle-right"></i>
|
||||
{{ $info->title }}
|
||||
{{-- <span>{{ $info->created_at->format('Y-m-d') }}</span>--}}
|
||||
{{--<span>{{ $info->created_at->format('Y-m-d') }}</span>--}}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@if (getArtilesByCates(11)->isNotEmpty())
|
||||
<div class="newCont-ul">
|
||||
<div style="font-weight: 600">{{ getOneCategory(11,'title') }}</div>
|
||||
<ul class="index-mian-news-ul">
|
||||
@foreach (getArtilesByCates(11,6) as $info)
|
||||
<li>
|
||||
<a href="{{ $info->link }}" class="nowrap">
|
||||
<i class="fa fa-chevron-circle-right"></i>
|
||||
{{ $info->title }}
|
||||
{{--<span>{{ $info->created_at->format('Y-m-d') }}</span>--}}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 科技成果 -->
|
||||
@@ -177,7 +206,7 @@
|
||||
@endif
|
||||
</div>
|
||||
<!-- 视频新闻 -->
|
||||
<div class="index-mian-title">
|
||||
{{--<div class="index-mian-title">
|
||||
<span><i class="fa fa-play-circle"></i>{{ getOneCategory(56,'title') }}</span>
|
||||
</div>
|
||||
<div class="index-mian-right-video">
|
||||
@@ -195,7 +224,40 @@
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>--}}
|
||||
|
||||
|
||||
<!-- 媒体宣传 -->
|
||||
<div class="index-mian-title">
|
||||
<span><i class="fa fa-play-circle"></i>媒体宣传</span>
|
||||
</div>
|
||||
<ul class="index-mian-news-ul index-mian-notice-ul">
|
||||
@if (getArticlesBYCate(86,3)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(86,3) as $article)
|
||||
<li class="index-mian-news-ul_media">
|
||||
<a href="{{ $article->link }}" class="nowrap-multi">
|
||||
<i class="fa fa-chevron-circle-right"></i>
|
||||
{{ $article->title }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
<!-- 快速入口 -->
|
||||
<div class="index-mian-right-ads">
|
||||
@if ($xz_right_advert->isNotEmpty())
|
||||
@foreach ($xz_right_advert as $advert)
|
||||
<a class="index-mian-right-ad index-mian-right-ad-5"
|
||||
style="background-image: url({{ $advert->cover_path }});"
|
||||
href="{{ $advert->url }}"
|
||||
>
|
||||
</a>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 党群原地 -->
|
||||
<div class="index-mian-title">
|
||||
<span><i class="fa fa-group"></i>{{ getOneCategory(57,'title') }}</span>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>@section('title'){{ config('app.name', '') }}@show</title>
|
||||
<meta content="黑龙江省科学院智能制造研究所" name="Keywords">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta content="黑龙江省科学院智能制造研究所" name="Keywords" >
|
||||
<meta content="黑龙江省科学院智能制造研究所" name="description">
|
||||
<link rel="icon" href="{{ asset('assets/index/img/favicon.ico') }}" mce_href="favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('assets/index/css/font-awesome.min.css') }}"/>
|
||||
@@ -12,7 +14,7 @@
|
||||
@yield('css')
|
||||
@yield('js')
|
||||
</head>
|
||||
<body>
|
||||
<body class="bg">
|
||||
<!-- tool -->
|
||||
<div class="tool">
|
||||
<div class="container tool-content">
|
||||
@@ -39,6 +41,7 @@
|
||||
<div class="header-text">
|
||||
卓越创新 智慧创造
|
||||
</div>
|
||||
<img class="mb mbLogo-nav" src="{{ asset('assets/index/img/index_nav.png') }}" alt="">
|
||||
</div>
|
||||
</header>
|
||||
<!-- end header -->
|
||||
@@ -75,11 +78,11 @@
|
||||
<!-- footer -->
|
||||
<footer class="footer">
|
||||
<p>
|
||||
版权所有:黑龙江省科学院智能制造研究所 <a target="_blank" href="https://beian.miit.gov.cn/"
|
||||
style="color: white">黑ICP备2020005648号</a>
|
||||
版权所有:黑龙江省科学院智能制造研究所<a target="_blank" href="https://beian.miit.gov.cn/"
|
||||
>黑ICP备2020005648号</a>
|
||||
</p>
|
||||
<p>地址:黑龙江省哈尔滨市南岗区汉水路165号 邮政编码:150090</p>
|
||||
<p>电话:0451-82300045 eMail:webmaster@haai.com.cn</p>
|
||||
<p>地址:黑龙江省哈尔滨市南岗区汉水路165号<span>邮政编码:150090</span></p>
|
||||
<p>电话:0451-82300045<span >eMail:webmaster@haai.com.cn</span></p>
|
||||
<p>© CopyRight 2020-2030,Heilongjiang Academy of Sciences Intelligent Manufacturing Research Institute.</p>
|
||||
<script type="text/javascript">document.write(unescape("%3Cspan id='_ideConac' %3E%3C/span%3E%3Cscript src='http://dcs.conac.cn/js/10/000/0000/40685364/CA100000000406853640007.js' type='text/javascript'%3E%3C/script%3E"));</script>
|
||||
</footer>
|
||||
@@ -105,6 +108,10 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
// 导航
|
||||
$(".mbLogo-nav").click(function () {
|
||||
$(".nav").slideToggle();
|
||||
});
|
||||
</script>
|
||||
<!-- end script -->
|
||||
</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- nav -->
|
||||
<nav class="nav">
|
||||
<nav class="container nav">
|
||||
<div class="container nav-content">
|
||||
<ul class="nav-ul" id="nav">
|
||||
<li class="nav-ul-li @if (!isset($parent)) show @endif">
|
||||
@@ -25,6 +25,14 @@
|
||||
<a href="{{ getOneCategory(config('haai.category.djkxwh'),'link') }}">{{ getOneCategory(config('haai.category.djkxwh'),'title') }}</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-ul-li @if (isset($parent) && $parent->id==config('haai.category.yjsgg')) show @endif">
|
||||
<a href="{{ getOneCategory(config('haai.category.yjsgg'),'link') }}">{{ getOneCategory(config('haai.category.yjsgg'),'title') }}</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-ul-li @if (isset($parent) && $parent->id==config('haai.category.gsxxjy')) show @endif">
|
||||
<a href="{{ getOneCategory(config('haai.category.gsxxjy'),'link') }}">{{ getOneCategory(config('haai.category.gsxxjy'),'title') }}</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -22,7 +22,4 @@ Route::get('patents/{patent}/show', 'PatentController@show')->name('patents.show
|
||||
Route::get('patents/list', 'PatentController@list')->name('patents.list');
|
||||
|
||||
//以下为导入数据
|
||||
Route::get('test/set_category', 'TestController@set_category');
|
||||
Route::get('test/set_article', 'TestController@set_article');
|
||||
Route::get('test/set_cate_article', 'TestController@setCateArticle');
|
||||
Route::get('test/check_article', 'TestController@checkArticle');
|
||||
Route::get('test/set_article_category', 'TestController@set_article_category');
|
||||
|
||||