Files
douba_shop/app/validate/supplier/SystemSupplierValidate.php
Karlcarlo c9a98f342c chore: 添加静态资源文件和版本配置文件
添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材
添加系统版本配置文件(.version)和常量定义文件(.constant)
更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件
添加验证码配置文件(captcha.php)和.gitignore规则
2026-03-06 20:14:23 +08:00

72 lines
2.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\validate\supplier;
use think\Validate;
class SystemSupplierValidate extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [
'supplier_name' => 'require|max:25',
'name' => 'max:25',
'phone' => 'require|mobile',
'email' => 'email|max:50',
'address' => 'max:255',
'province' => 'gt:0',
'city' => 'gt:0',
'area' => 'gt:0',
'detailed_address' => 'max:255',
'account' => 'require',
'pwd' => ['require', 'length:4,64'],
'mark' => 'max:255',
];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [
'supplier_name.require' => '请填写供应商名称',
'supplier_name.max' => '供应商名称最多不能超过25个字符',
'name.max' => '名称最多不能超过25个字符',
'phone.require' => '请填写手机号',
'phone.mobile' => '手机号格式不正确',
'email.email' => '邮箱格式不正确',
'email.max' => '邮箱最多不能超过100个字符',
'address.max' => '供应商地址最多不能超过255个字符',
'mark.max' => '备注最多不能超过255个字符',
'province.gt' => '省份信息错误',
'city.gt' => '城市信息错误',
'area.gt' => '地区信息错误',
'detailed_address.max' => '详细地址最多不能超过255个字符',
'account.require' => '请填写供应商登录用户名',
// 'account.length' => '供应商登录用户名4-64长度字符',
'pwd.require' => '请输入密码',
'pwd.length' => '密码长度4-64位字符',
];
protected $scene = [
'login' => ['account', 'pwd'],
'update' => ['supplier_name', 'name', 'phone', 'email', 'address', 'detailed_address', 'province', 'city', 'area'],
'save' => ['supplier_name', 'name', 'phone', 'email', 'address', 'detailed_address', 'province', 'city', 'area','account', 'pwd', 'mark'],
'admin_update' => ['supplier_name', 'name', 'phone', 'email', 'address', 'detailed_address', 'province', 'city', 'area','account', 'mark'],
];
}