35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace app\common\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class CorpValidate extends Validate
|
|
{
|
|
protected $rule = [
|
|
'id' => 'require|number',
|
|
'name' => 'require|max:255',
|
|
'abbr' => 'require|in:hesu,xinyouhe,paika,simate,mbaf',
|
|
'tenant_key' => 'string',
|
|
'sort' => 'number',
|
|
'status' => 'require|in:0,1'
|
|
];
|
|
|
|
protected $message = [
|
|
'id.require' => 'ID不能为空',
|
|
'id.number' => 'ID必须是数字',
|
|
'name.require' => '企业名称不能为空',
|
|
'name.max' => '企业名称长度不能超过255个字符',
|
|
'abbr.require' => '企业缩写不能为空',
|
|
'abbr.in' => '企业缩写必须是 hesu,xinyouhe,paika,simate,mbaf 中的一个',
|
|
'tenant_key.string' => '飞书企业标识必须是字符串',
|
|
'sort.number' => '排序值必须是数字',
|
|
'status.require' => '状态不能为空',
|
|
'status.in' => '状态必须是0或1'
|
|
];
|
|
|
|
protected $scene = [
|
|
'store' => ['name', 'abbr', 'tenant_key', 'sort', 'status'],
|
|
'update' => ['id', 'name', 'abbr', 'tenant_key', 'sort', 'status']
|
|
];
|
|
} |