fix: 修复横幅编辑保存时验证bug

This commit is contained in:
2025-03-31 15:06:50 +08:00
parent 4ff393397e
commit bb15fc4033

View File

@@ -23,7 +23,7 @@ class SysBannerItemValidate extends Validate
'type' => 'in:image,video',
'image' => 'max:255',
'video' => 'max:255',
'link_to' => 'requireWith:image|max:64|in:article,article_category,product,product_category,custom',
'link_to' => 'requireIf:type,image|max:64|in:article,article_category,product,product_category,custom',
'link' => 'max:255',
'sort' => 'integer',
'status' => 'in:-1,1'
@@ -48,10 +48,10 @@ class SysBannerItemValidate extends Validate
'type.in' => '显示类型必须是image或video',
'image.max' => '图片地址最多不能超过255个字符',
'video.max' => '视频地址最多不能超过255个字符',
'link_to.requireWith' => '接类型不能为空',
'link_to.max' => '接类型最多不能超过64个字符',
'link_to.in' => '接类型必须是article,article_category,product,product_category,custom中之一',
'link.max' => '接最多不能超过255个字符',
'link_to.requireIf' => '接类型不能为空',
'link_to.max' => '接类型最多不能超过64个字符',
'link_to.in' => '接类型必须是article,article_category,product,product_category,custom中之一',
'link.max' => '接最多不能超过255个字符',
'sort.integer' => '排序值必须是整数',
'status.in' => '状态必须是-1或1'
];