From 8a208aa7754af9b55b33690ec04c0023920fd04c Mon Sep 17 00:00:00 2001 From: muzi_ys <1099438829@qq.com> Date: Sat, 6 Aug 2022 23:39:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Article.php | 1 + app/admin/view/article/add.html | 12 +++++++++++- app/admin/view/article/edit.html | 13 +++++++++++-- app/common/model/Document.php | 1 + app/index/common.php | 3 ++- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/admin/controller/Article.php b/app/admin/controller/Article.php index d55887b..c6c9315 100644 --- a/app/admin/controller/Article.php +++ b/app/admin/controller/Article.php @@ -87,6 +87,7 @@ class Article extends AuthController ['is_hot', 0], ['theme', 'detail.html'], ['link_str', ''], + ['is_jump', 0], ['cover_path', ''], ['display', 1], ['tags', ''], diff --git a/app/admin/view/article/add.html b/app/admin/view/article/add.html index 29f774b..e431ad7 100644 --- a/app/admin/view/article/add.html +++ b/app/admin/view/article/add.html @@ -118,7 +118,17 @@
- +
+
+ +
+
+ +
+
diff --git a/app/admin/view/article/edit.html b/app/admin/view/article/edit.html index 192426f..35a4633 100644 --- a/app/admin/view/article/edit.html +++ b/app/admin/view/article/edit.html @@ -138,8 +138,17 @@
- +
+
+ +
+
+ +
+
diff --git a/app/common/model/Document.php b/app/common/model/Document.php index df501db..e5b383d 100644 --- a/app/common/model/Document.php +++ b/app/common/model/Document.php @@ -114,6 +114,7 @@ class Document extends BaseModel if ($data['is_hot']) $data['is_hot'] = 1; if ($data['display']) $data['display'] = 1; if ($data['is_top']) $data['is_top'] = 1; + if ($data['is_jump']) $data['is_jump'] = 1; //判断是否主键冲突 $info = $this->where("alias", $data['alias'])->find(); if ($info && (!empty($data['id']) && $info->id != $data['id'])) { diff --git a/app/index/common.php b/app/index/common.php index 4d5d9c5..26c5f92 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -435,7 +435,8 @@ function make_category_url($item) function make_detail_url($item) { //根据栏目类型,生成栏目url - if ($item['link_str']) { + //详情根据是否跳转外链来生成 + if ($item['link_str'] && $item['is_jump']) { return $item['link_str']; } else { return url($item['type'].'/detail', ['id'=>$item['alias']?:$item['id']])->build();