From ecd0cc8752768646539417e9f9909afc57f0f999 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Fri, 28 Feb 2025 10:09:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=8E=BB=E9=99=A4=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E7=AE=A1=E7=90=86seo=E7=9B=B8=E5=85=B3=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/v1/ArticleCategory.php | 15 +++------------ app/admin/controller/v1/ProductCategory.php | 10 ++-------- app/common/model/ArticleCategoryBaseModel.php | 3 --- app/common/model/ProductCategoryBaseModel.php | 3 --- .../20241219090629_create_product_category.php | 3 --- .../20241220062425_create_article_category.php | 3 --- 6 files changed, 5 insertions(+), 32 deletions(-) diff --git a/app/admin/controller/v1/ArticleCategory.php b/app/admin/controller/v1/ArticleCategory.php index 2e068a85..5af888bb 100644 --- a/app/admin/controller/v1/ArticleCategory.php +++ b/app/admin/controller/v1/ArticleCategory.php @@ -37,10 +37,7 @@ class ArticleCategory $category = ArticleCategoryModel::withoutField([ 'language_id', - 'deleted_at', - 'seo_title', - 'seo_keywords', - 'seo_desc', + 'deleted_at' ]) ->language(request()->lang_id) ->where(function($query) use($param) { @@ -76,10 +73,7 @@ class ArticleCategory $post = request()->post([ 'name', 'sort' => 0, - 'is_show' => 1, - 'seo_title', - 'seo_keywords', - 'seo_desc', + 'is_show' => 1 ]); $data = array_merge($post, ['language_id' => request()->lang_id]); @@ -102,10 +96,7 @@ class ArticleCategory $put = request()->put([ 'name', 'sort', - 'is_show', - 'seo_title', - 'seo_keywords', - 'seo_desc', + 'is_show' ]); $data = array_merge($put, ['language_id' => request()->lang_id]); diff --git a/app/admin/controller/v1/ProductCategory.php b/app/admin/controller/v1/ProductCategory.php index a4dd95d7..15cc1aab 100644 --- a/app/admin/controller/v1/ProductCategory.php +++ b/app/admin/controller/v1/ProductCategory.php @@ -74,10 +74,7 @@ class ProductCategory 'related_tco_category', 'sort', 'level' => 1, - 'is_show' => 1, - 'seo_title', - 'seo_keywords', - 'seo_desc' + 'is_show' => 1 ]); if (empty($post['unique_id'])) { $post['unique_id'] = md5(uniqid()); @@ -120,10 +117,7 @@ class ProductCategory 'related_tco_category', 'sort', 'level' => 1, - 'is_show' => 1, - 'seo_title', - 'seo_keywords', - 'seo_desc' + 'is_show' => 1 ]); $data = array_merge($put, [ 'id' => $id, diff --git a/app/common/model/ArticleCategoryBaseModel.php b/app/common/model/ArticleCategoryBaseModel.php index b15a6566..a5f1abfe 100644 --- a/app/common/model/ArticleCategoryBaseModel.php +++ b/app/common/model/ArticleCategoryBaseModel.php @@ -26,9 +26,6 @@ class ArticleCategoryBaseModel extends BaseModel 'sort' => 'int', 'level' => 'int', 'is_show' => 'int', - 'seo_title' => 'string', - 'seo_keywords' => 'string', - 'seo_desc' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', diff --git a/app/common/model/ProductCategoryBaseModel.php b/app/common/model/ProductCategoryBaseModel.php index 3ea5614d..ad53062b 100644 --- a/app/common/model/ProductCategoryBaseModel.php +++ b/app/common/model/ProductCategoryBaseModel.php @@ -28,9 +28,6 @@ class ProductCategoryBaseModel extends BaseModel 'sort' => 'int', 'level' => 'int', 'is_show' => 'int', - 'seo_title' => 'string', - 'seo_keywords' => 'string', - 'seo_desc' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', diff --git a/database/migrations/20241219090629_create_product_category.php b/database/migrations/20241219090629_create_product_category.php index 2bc76010..dc322058 100644 --- a/database/migrations/20241219090629_create_product_category.php +++ b/database/migrations/20241219090629_create_product_category.php @@ -39,9 +39,6 @@ class CreateProductCategory extends Migrator ->addColumn('sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '排序']) ->addColumn('level', 'integer', ['limit' => MysqlAdapter::INT_TINY,'null' => false, 'default' => 1, 'comment' => '层级']) ->addColumn('is_show', 'boolean', ['null' => false, 'default' => 1, 'comment' => '是否显示:1是,0否']) - ->addColumn('seo_title', 'string', ['limit' => 255, 'default' => null, 'comment' => 'SEO标题']) - ->addColumn('seo_keywords', 'string', ['limit' => 255, 'default' => null, 'comment' => 'SEO关键字']) - ->addColumn('seo_desc', 'string', ['limit' => 255, 'default' => null, 'comment' => 'SEO描述']) ->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '新增时间']) ->addColumn('updated_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'update' => 'CURRENT_TIMESTAMP', 'comment' => '更新时间']) ->addColumn('deleted_at', 'timestamp', ['null' => true, 'comment' => '删除时间']) diff --git a/database/migrations/20241220062425_create_article_category.php b/database/migrations/20241220062425_create_article_category.php index d654826d..c574423b 100644 --- a/database/migrations/20241220062425_create_article_category.php +++ b/database/migrations/20241220062425_create_article_category.php @@ -38,9 +38,6 @@ class CreateArticleCategory extends Migrator ->addColumn('sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '排序']) ->addColumn('level', 'integer', ['limit' => MysqlAdapter::INT_TINY,'null' => false, 'default' => 1, 'comment' => '层级']) ->addColumn('is_show', 'boolean', ['null' => false, 'default' => 1, 'comment' => '是否显示:1是,0否']) - ->addColumn('seo_title', 'string', ['limit' => 255, 'default' => null, 'comment' => 'SEO标题']) - ->addColumn('seo_keywords', 'string', ['limit' => 255, 'default' => null, 'comment' => 'SEO关键字']) - ->addColumn('seo_desc', 'string', ['limit' => 255, 'default' => null, 'comment' => 'SEO描述']) ->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '新增时间']) ->addColumn('updated_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'update' => 'CURRENT_TIMESTAMP', 'comment' => '更新时间']) ->addColumn('deleted_at', 'timestamp', ['null' => true, 'comment' => '删除时间'])