diff --git a/app/admin/controller/v1/Attachment.php b/app/admin/controller/v1/Attachment.php index 2775c476..375b8206 100644 --- a/app/admin/controller/v1/Attachment.php +++ b/app/admin/controller/v1/Attachment.php @@ -75,7 +75,6 @@ class Attachment 'attach', 'sort', 'recommend', - 'status', 'seo_title', 'seo_keywords', 'seo_desc' @@ -188,25 +187,6 @@ class Attachment return success('操作成功'); } - /** - * 禁/启用 - */ - public function enable() - { - $id = request()->param('id'); - - $attachment = AttachmentModel::bypk($id)->find(); - if (empty($attachment)) { - return error('请确认操作对象是否存在'); - } - - $attachment->status = $attachment->status == 1 ? -1 : 1; - if (!$attachment->save()) { - return error('操作失败'); - } - return success('操作成功'); - } - /** * 附件删除 */ diff --git a/app/common/model/AttachmentBaseModel.php b/app/common/model/AttachmentBaseModel.php index 49ba9c3c..68bb53a4 100644 --- a/app/common/model/AttachmentBaseModel.php +++ b/app/common/model/AttachmentBaseModel.php @@ -28,7 +28,6 @@ class AttachmentBaseModel extends BaseModel 'attach' => 'json', 'sort' => 'int', 'recommend' => 'int', - 'status' => 'int', 'seo_title' => 'string', 'seo_keywords' => 'string', 'seo_desc' => 'string', diff --git a/database/migrations/20241220094223_create_attachment.php b/database/migrations/20241220094223_create_attachment.php index 14aca3b2..aa11f2dd 100644 --- a/database/migrations/20241220094223_create_attachment.php +++ b/database/migrations/20241220094223_create_attachment.php @@ -39,7 +39,6 @@ class CreateAttachment extends Migrator ->addColumn('attach', 'json', ['null' => false, 'comment' => '附件地址: $[*].file_path为附件地址, $[*].file_ext为文件格式, $[*].btn_name为下载按钮名称']) ->addColumn('sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '排序']) ->addColumn('recommend', 'boolean', ['null' => false, 'default' => 0, 'comment' => '是否推荐:1是,0否']) - ->addColumn('status', MysqlAdapter::PHINX_TYPE_TINY_INTEGER, ['null' => false, 'default' => 1, 'comment' => '状态:1为启用,-1为禁用']) ->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描述'])