refactor: 新增/编辑操作中未有启用状态字段的添加启用状态字段

This commit is contained in:
2025-03-31 16:04:11 +08:00
parent 05cc5ac28e
commit de9305f43c
5 changed files with 9 additions and 1 deletions

View File

@@ -93,6 +93,7 @@ class Article
'content',
'recommend',
'release_time',
'enabled' => 1,
'seo_title',
'seo_keywords',
'seo_desc',
@@ -125,6 +126,7 @@ class Article
'content',
'recommend',
'release_time',
'enabled',
'seo_title',
'seo_keywords',
'seo_desc',

View File

@@ -91,6 +91,7 @@ class Attachment
'applicable_to',
'support_platform',
'attach',
'status' => 1,
'seo_title',
'seo_keywords',
'seo_desc'
@@ -126,6 +127,7 @@ class Attachment
'applicable_to',
'support_platform',
'attach',
'status',
'seo_title',
'seo_keywords',
'seo_desc'

View File

@@ -98,7 +98,7 @@ class BannerItem
'link_to' => 'custom',
'link',
'sort',
'status'
'status' => 1
]);
$validate = new SysBannerItemValidate;

View File

@@ -23,6 +23,7 @@ class ArticleValidate extends Validate
'sort' => 'integer',
'recommend' => 'require|in:0,1',
'release_time' => 'dateFormat:Y-m-d H:i:s',
'enabled' => 'in:1,-1',
'seo_title' => 'max:255',
'seo_keywords' => 'max:255',
'seo_desc' => 'max:255'
@@ -48,6 +49,7 @@ class ArticleValidate extends Validate
'recommend.require' => '推荐状态不能为空',
'recommend.in' => '推荐状态的值必须是0或1',
'release_time.dateFormat' => '发布时间格式不正确',
'enabled.in' => '状态值必须是1或-1',
'seo_title.max' => 'SEO标题长度不能超过255个字符',
'seo_keywords.max' => 'SEO关键字长度不能超过255个字符',
'seo_desc.max' => 'SEO描述长度不能超过255个字符'

View File

@@ -26,6 +26,7 @@ class AttachmentValidate extends Validate
'attach.*.ext' => 'string',
'attach.*.btn_name' => 'string',
'sort' => 'integer',
'status' => 'in:1,-1',
'recommend' => 'in:0,1',
'seo_title' => 'max:255',
'seo_keywords' => 'max:255',
@@ -55,6 +56,7 @@ class AttachmentValidate extends Validate
'attach.*.file_ext.string' => '附件扩展名必须是字符串',
'attach.*.btn_name.string' => '附件按钮名必须是字符串',
'sort.integer' => '排序必须是整数',
'status.in' => '状态必须是1或-1',
'recommend.in' => '推荐状态必须是0或1',
'seo_title.max' => 'SEO标题不能超过255个字符',
'seo_keywords.max' => 'SEO关键字不能超过255个字符',