diff --git a/app/Admin/Controllers/Article/IndexController.php b/app/Admin/Controllers/Article/IndexController.php index f31313b..3109c1f 100644 --- a/app/Admin/Controllers/Article/IndexController.php +++ b/app/Admin/Controllers/Article/IndexController.php @@ -39,7 +39,7 @@ class IndexController extends AdminController return $this->categories()->pluck('title'); })->label(); $grid->column('title', '文章标题'); - $grid->column('sort', '序号'); + $grid->column('sort', '序号')->editable(); $states = [ 'on' => ['value' => 1, 'text' => '打开', 'color' => 'primary'], 'off' => ['value' => 2, 'text' => '关闭', 'color' => 'default'], @@ -62,7 +62,7 @@ class IndexController extends AdminController $form->belongsToMany('categories', CategorySelectAble::class, __('关联分类'))->required(); $form->textarea('description', '内容简介'); - + $form->text('duty', '职务')->help('领导班子需要添加此数据'); $form->text('rank', '职称')->help('领导班子需要添加此数据'); diff --git a/app/Helpers/function.php b/app/Helpers/function.php index 3d99365..389b5e6 100644 --- a/app/Helpers/function.php +++ b/app/Helpers/function.php @@ -53,7 +53,8 @@ function getOneArticleBYCate($categoryId, $result = '') ->whereHas('categories', function ($q) use ($categoryId) { $q->where('id', $categoryId); }) - ->latest() + ->latest('sort') + ->latest('created_at') ->first(); if ($info) { @@ -87,7 +88,8 @@ function getArticlesBYCate($categoryId, $take = 8, $mark = 'one', $hasCover = fa ->whereHas('categories', function ($q) use ($categoryId) { $q->where('id', $categoryId); }) - ->orderBy('sort', $order) + ->latest('sort') + ->latest('created_at') ->when($hasCover, function ($q) { $q->whereNotNull('cover'); }) @@ -104,7 +106,8 @@ function getArticlesBYCate($categoryId, $take = 8, $mark = 'one', $hasCover = fa ->when($hasCover, function ($q) { $q->whereNotNull('cover'); }) - ->orderBy('sort', $order) + ->latest('sort') + ->latest('created_at') ->take($take) ->get(); } @@ -179,7 +182,8 @@ function getArticlesByCateIds($take = 8, $hasCover = false) ->whereHas('categories', function ($q) use ($ids) { $q->whereIn('id', $ids); }) - ->latest() + ->latest('sort') + ->latest('created_at') ->when($hasCover, function ($q) { $q->whereNotNull('cover')->orWhere('cover', '<>', ''); }) @@ -200,7 +204,8 @@ function getArticlesByCateIds($take = 8, $hasCover = false) function getArticlesByPosition($postion) { $articles = Article::ofPosition($postion) - ->latest() + ->latest('sort') + ->latest('created_at') ->take(5) ->get(); diff --git a/public/assets/index/css/style.css b/public/assets/index/css/style.css index 1d9ba00..71fa3ef 100644 --- a/public/assets/index/css/style.css +++ b/public/assets/index/css/style.css @@ -210,6 +210,12 @@ img {max-width: 100%;} .indexPrize-img {position: relative; width: 100%; padding-top: 70%; margin-bottom: 10px; display: block;} .indexPrize-title {font-size: 18px;} .indexPrize-pagination {bottom: -5px !important;} +.IndexExpertNew {overflow: hidden; margin: 0 20px;} +.IndexExpertNew li { width: calc(33.33% - 40px); float: left; margin: 20px; padding: 15px 0; text-align: center; box-sizing: border-box;border: 1px solid #f5f5f5;border-radius: 5px;background: #f5f5f5;} +.IndexExpertNew-title {font-size: 18px; font-weight: 600} +.IndexExpertNew-tips {margin-bottom: 20px; color: #999; display: block; position: relative;} +.IndexExpertNew-tips::after {position: absolute; content: ''; left: calc(50% - 16px); bottom: -10px; background-color: #ffb993; width: 30px; height: 4px; + border-radius: 22px;} /* 友情链接 */ diff --git a/resources/views/category/dzjs.blade.php b/resources/views/category/dzjs.blade.php index 4645310..139b552 100644 --- a/resources/views/category/dzjs.blade.php +++ b/resources/views/category/dzjs.blade.php @@ -16,16 +16,19 @@ {{ getOneCategory(12,'title') }} -