From 2acd7919d5290d4af562ae848e3a3781cb9f6523 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Fri, 28 Mar 2025 15:31:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E6=A8=AA?= =?UTF-8?q?=E5=B9=85=E8=BF=9E=E6=8E=A5=E7=B1=BB=E5=9E=8B=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../validate/v1/SysBannerItemValidate.php | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/app/admin/validate/v1/SysBannerItemValidate.php b/app/admin/validate/v1/SysBannerItemValidate.php index 006aef60..deef3968 100644 --- a/app/admin/validate/v1/SysBannerItemValidate.php +++ b/app/admin/validate/v1/SysBannerItemValidate.php @@ -23,7 +23,7 @@ class SysBannerItemValidate extends Validate 'type' => 'in:image,video', 'image' => 'max:255', 'video' => 'max:255', - 'link_to' => 'require|max:64|in:article,article_category,product,product_category,custom', + 'link_to' => 'requireWith:image|max:64|in:article,article_category,product,product_category,custom', 'link' => 'max:255', 'sort' => 'integer', 'status' => 'in:-1,1' @@ -36,24 +36,24 @@ class SysBannerItemValidate extends Validate * @var array */ protected $message = [ - 'id.require' => 'ID不能为空', - 'id.integer' => 'ID必须是整数', - 'banner_id.require' => '横幅项分类不能为空', - 'banner_id.integer' => '横幅项分类必须是整数', - 'title.require' => '名称不能为空', - 'title.max' => '名称最多不能超过128个字符', - 'title_txt_color.max' => '名称字体颜色最多不能超过7个字符', - 'desc.max' => '描述最多不能超过255个字符', - 'desc_txt_color.max' => '描述字体颜色最多不能超过7个字符', - 'type.in' => '显示类型必须是image或video', - 'image.max' => '图片地址最多不能超过255个字符', - 'video.max' => '视频地址最多不能超过255个字符', - 'link_to.require' => '连接类型不能为空', - 'link_to.max' => '连接类型最多不能超过64个字符', - 'link_to.in' => '连接类型必须是article,article_category,product,product_category,custom中之一', - 'link.max' => '连接最多不能超过255个字符', - 'sort.integer' => '排序值必须是整数', - 'status.in' => '状态必须是-1或1' + 'id.require' => 'ID不能为空', + 'id.integer' => 'ID必须是整数', + 'banner_id.require' => '横幅项分类不能为空', + 'banner_id.integer' => '横幅项分类必须是整数', + 'title.require' => '名称不能为空', + 'title.max' => '名称最多不能超过128个字符', + 'title_txt_color.max' => '名称字体颜色最多不能超过7个字符', + 'desc.max' => '描述最多不能超过255个字符', + 'desc_txt_color.max' => '描述字体颜色最多不能超过7个字符', + '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个字符', + 'sort.integer' => '排序值必须是整数', + 'status.in' => '状态必须是-1或1' ]; // 新增场景