From 627c17122f4b28bb5525bf5a51246d5833234088 Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Tue, 20 Jul 2021 16:44:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/CategoryController.php | 5 ++- config/setting.php | 5 +++ resources/views/category/dzjs.blade.php | 6 +-- resources/views/category/fygk.blade.php | 20 +-------- resources/views/category/ldbz.blade.php | 20 +-------- resources/views/category/left.blade.php | 7 +++- resources/views/category/nsjg.blade.php | 31 ++++---------- resources/views/category/rcdw.blade.php | 2 +- resources/views/category/xwdt.blade.php | 46 +++++++++++++++++++-- 9 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 config/setting.php diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 87ed193..59d343a 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -11,7 +11,7 @@ class CategoryController extends Controller /** * 显示分类 * @param Category $category [description] - * @return [type] [description] + * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View [type] [description] */ public function index(Category $category) { @@ -24,7 +24,8 @@ class CategoryController extends Controller } $articles = $category->relations(Category::TYPE_ARTICLE) ->where('status', 1) - ->latest() + ->latest('sort') + ->latest('created_at') ->paginate(8); $parent = $category; diff --git a/config/setting.php b/config/setting.php new file mode 100644 index 0000000..24b8f9f --- /dev/null +++ b/config/setting.php @@ -0,0 +1,5 @@ + [13], +]; \ No newline at end of file diff --git a/resources/views/category/dzjs.blade.php b/resources/views/category/dzjs.blade.php index 82b56aa..5b6aa04 100644 --- a/resources/views/category/dzjs.blade.php +++ b/resources/views/category/dzjs.blade.php @@ -53,8 +53,8 @@ - + diff --git a/resources/views/category/fygk.blade.php b/resources/views/category/fygk.blade.php index 993ee6a..2c64255 100644 --- a/resources/views/category/fygk.blade.php +++ b/resources/views/category/fygk.blade.php @@ -6,24 +6,8 @@
- + @include('category.left') +
diff --git a/resources/views/category/ldbz.blade.php b/resources/views/category/ldbz.blade.php index 479a822..f36a1c2 100644 --- a/resources/views/category/ldbz.blade.php +++ b/resources/views/category/ldbz.blade.php @@ -6,24 +6,8 @@
-
-
- {{ $parent->title }} - -
-
    - @if ($parent->childrens->isNotEmpty()) - @foreach ($parent->childrens()->orderBy('order','asc')->get() as $child) -
  • id==$child->id) class="active" @endif> - {{ $child->title }} -
  • - @endforeach - @endif -
-
- -
-
+ @include('category.left') +
diff --git a/resources/views/category/left.blade.php b/resources/views/category/left.blade.php index beffea9..2b09fa3 100644 --- a/resources/views/category/left.blade.php +++ b/resources/views/category/left.blade.php @@ -8,7 +8,11 @@ @if ($parent->childrens->isNotEmpty()) @foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)
  • id==$child->id) class="active" @endif> - {{ $child->title }} + @if(in_array($parent->id,config('setting.no_href'))) + {{ $child->title }} + @else + {{ $child->title }} + @endif
  • @endforeach @endif @@ -18,3 +22,4 @@
    @endif + diff --git a/resources/views/category/nsjg.blade.php b/resources/views/category/nsjg.blade.php index f1f3dfc..9cbb99b 100644 --- a/resources/views/category/nsjg.blade.php +++ b/resources/views/category/nsjg.blade.php @@ -6,24 +6,7 @@
    -
    -
    - {{ $parent->title }} - -
    -
      - @if ($parent->childrens->isNotEmpty()) - @foreach ($parent->childrens()->orderBy('order','asc')->get() as $child) -
    • id==$child->id) class="active" @endif> - {{ $child->title }} -
    • - @endforeach - @endif -
    -
    - -
    -
    + @include('category.left')
    @@ -33,22 +16,22 @@ {{ getOneCategory(13,'title') }}
    - - 查看更多>> - +{{-- --}} + {{-- 查看更多>>--}} + {{-- --}}
    @if (getCateChild(13)->isNotEmpty()) @foreach (getCateChild(13) as $cate)
    - +
    -->
      @if($cate->childrens) @foreach ($cate->childrens as $child)
    • - {{ $child->title }} + {{ $child->title }}
    • @endforeach @endif diff --git a/resources/views/category/rcdw.blade.php b/resources/views/category/rcdw.blade.php index 94c5cf0..1f98b00 100644 --- a/resources/views/category/rcdw.blade.php +++ b/resources/views/category/rcdw.blade.php @@ -88,7 +88,7 @@ 客座教授
      {{ $article->title }}
    - +
    +
    +
    + + {{ getOneCategory(17,'title') }} +
    +
    + + +
    +