refactor: 后台横幅添加extra_image字段

This commit is contained in:
2025-06-30 09:12:24 +08:00
parent 9ab935e1ff
commit 9a9b714aad
4 changed files with 8 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ class BannerItem
'desc_txt_color', 'desc_txt_color',
'type', 'type',
'image', 'image',
'extra_image',
'video', 'video',
'link_to' => 'custom', 'link_to' => 'custom',
'link', 'link',
@@ -159,6 +160,7 @@ class BannerItem
'desc_txt_color', 'desc_txt_color',
'type', 'type',
'image', 'image',
'extra_image',
'video', 'video',
'link_to', 'link_to',
'link', 'link',
@@ -242,6 +244,7 @@ class BannerItem
'desc_txt_color' => '描述字体颜色', 'desc_txt_color' => '描述字体颜色',
'type' => '前台显示类型', 'type' => '前台显示类型',
'image' => '图片地址', 'image' => '图片地址',
'extra_image' => '额外图片地址',
'video' => '视频地址', 'video' => '视频地址',
'link_to' => '链接类型', 'link_to' => '链接类型',
'link' => '链接地址', 'link' => '链接地址',
@@ -274,6 +277,7 @@ class BannerItem
'item.desc_txt_color', 'item.desc_txt_color',
'item.type', 'item.type',
'item.image', 'item.image',
'item.extra_image',
'item.video', 'item.video',
'item.link_to', 'item.link_to',
'item.link', 'item.link',

View File

@@ -22,6 +22,7 @@ class SysBannerItemValidate extends Validate
'desc_txt_color' => 'max:7', 'desc_txt_color' => 'max:7',
'type' => 'in:image,video', 'type' => 'in:image,video',
'image' => 'max:255', 'image' => 'max:255',
'extra_image' => 'max:255',
'video' => 'max:255', 'video' => 'max:255',
'link_to' => 'requireIf:type,image|max:64|in:article,article_category,product,product_category,system_page,custom', 'link_to' => 'requireIf:type,image|max:64|in:article,article_category,product,product_category,system_page,custom',
'link' => 'max:255', 'link' => 'max:255',
@@ -47,6 +48,7 @@ class SysBannerItemValidate extends Validate
'desc_txt_color.max' => '描述字体颜色最多不能超过7个字符', 'desc_txt_color.max' => '描述字体颜色最多不能超过7个字符',
'type.in' => '显示类型必须是image或video', 'type.in' => '显示类型必须是image或video',
'image.max' => '图片地址最多不能超过255个字符', 'image.max' => '图片地址最多不能超过255个字符',
'extra_image.max' => '额外图片地址最多不能超过255个字符',
'video.max' => '视频地址最多不能超过255个字符', 'video.max' => '视频地址最多不能超过255个字符',
'link_to.requireIf' => '链接类型不能为空', 'link_to.requireIf' => '链接类型不能为空',
'link_to.max' => '链接类型最多不能超过64个字符', 'link_to.max' => '链接类型最多不能超过64个字符',

View File

@@ -25,6 +25,7 @@ class SysBannerItemBaseModel extends BaseModel
'desc_txt_color' => 'string', 'desc_txt_color' => 'string',
'type' => 'string', 'type' => 'string',
'image' => 'string', 'image' => 'string',
'extra_image' => 'string',
'video' => 'string', 'video' => 'string',
'link_to' => 'string', 'link_to' => 'string',
'link' => 'string', 'link' => 'string',

View File

@@ -36,6 +36,7 @@ class CreateSysBannerItem extends Migrator
->addColumn('desc_txt_color', 'string', ['limit' => 7, 'null' => false, 'default' => '', 'comment' => '描述文本颜色']) ->addColumn('desc_txt_color', 'string', ['limit' => 7, 'null' => false, 'default' => '', 'comment' => '描述文本颜色'])
->addColumn('type', 'string', ['limit' => 16, 'null' => false, 'comment' => '类型: image为图片, video为视频']) ->addColumn('type', 'string', ['limit' => 16, 'null' => false, 'comment' => '类型: image为图片, video为视频'])
->addColumn('image', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '图片']) ->addColumn('image', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '图片'])
->addColumn('extra_image', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '额外的图片'])
->addColumn('video', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '视频']) ->addColumn('video', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '视频'])
->addColumn('link_to', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '链接到(类型): article:文章, article_category:文章分类, product:产品, product_category:产品分类, custom:自定义链接']) ->addColumn('link_to', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '链接到(类型): article:文章, article_category:文章分类, product:产品, product_category:产品分类, custom:自定义链接'])
->addColumn('link', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '链接']) ->addColumn('link', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '链接'])