feat: 系统商城店铺入口
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 2s

This commit is contained in:
2026-03-28 11:37:26 +08:00
parent 4c592d9347
commit 90b4bccbcf
6 changed files with 427 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?php
declare (strict_types = 1);
namespace app\admin\validate\v1;
use think\Validate;
class SysMallStoreEntranceValidate extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [
'id' => 'require|integer',
'language_id' => 'require|integer',
'name' => 'require|max:255',
'image' => 'require|max:255',
'hover_image' => 'max:255',
'link' => 'max:500',
'sort' => 'require|integer',
'disabled' => 'in:0,1',
];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [
'id.require' => 'ID不能为空',
'id.integer' => 'ID必须是整数',
'language_id.require' => '语言ID不能为空',
'language_id.integer' => '语言ID必须是整数',
'name.require' => '商城名称不能为空',
'name.max' => '商城名称长度不能超过:rule个字符',
'image.require' => '图片不能为空',
'image.max' => '图片长度不能超过:rule个字符',
'hover_image.max' => '悬浮图长度不能超过:rule个字符',
'link.max' => '链接地址长度不能超过:rule个字符',
'sort.require' => '排序不能为空',
'sort.integer' => '排序必须是整数',
'disabled.in' => '禁用状态只能是0或1',
];
// 新增场景
protected function sceneCreate()
{
return $this->remove('id', 'require|integer');
}
// 更新场景
protected function sceneUpdate()
{
return $this->append('id', 'require|integer');
}
}