refactor: 横幅标题字数限制改为256

This commit is contained in:
2025-04-22 11:14:52 +08:00
parent 04a6b730af
commit 782ddda8fe
2 changed files with 3 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ class SysBannerItemValidate extends Validate
protected $rule = [
'id' => 'require|integer',
'banner_id' => 'require|integer',
'title' => 'require|max:128',
'title' => 'require|max:256',
'title_txt_color' => 'max:7',
'desc' => 'max:1024',
'desc_txt_color' => 'max:7',
@@ -41,7 +41,7 @@ class SysBannerItemValidate extends Validate
'banner_id.require' => '横幅项分类不能为空',
'banner_id.integer' => '横幅项分类必须是整数',
'title.require' => '名称不能为空',
'title.max' => '名称最多不能超过128个字符',
'title.max' => '名称最多不能超过256个字符',
'title_txt_color.max' => '名称字体颜色最多不能超过7个字符',
'desc.max' => '描述最多不能超过1024个字符',
'desc_txt_color.max' => '描述字体颜色最多不能超过7个字符',

View File

@@ -30,7 +30,7 @@ class CreateSysBannerItem extends Migrator
{
$table = $this->table('sys_banner_item', ['engine' => 'InnoDB', 'comment' => '系统Banner项表']);
$table->addColumn('banner_id', 'integer', ['null' => false, 'comment' => '所属Banner ID'])
->addColumn('title', 'string', ['limit' => 128, 'null' => false, 'comment' => '标题'])
->addColumn('title', 'string', ['limit' => 256, 'null' => false, 'comment' => '标题'])
->addColumn('title_txt_color', 'string', ['limit' => 7, 'null' => false, 'default' => '', 'comment' => '标题文本颜色'])
->addColumn('desc', MysqlAdapter::PHINX_TYPE_TEXT, ['null' => true, 'default' => null, 'comment' => '描述'])
->addColumn('desc_txt_color', 'string', ['limit' => 7, 'null' => false, 'default' => '', 'comment' => '描述文本颜色'])