caipan_shop_admin/app/validate/StaffValidate.php

24 lines
617 B
PHP
Raw Normal View History

2022-05-25 11:35:57 +00:00
<?php
namespace app\validate;
use think\Validate;
class StaffValidate extends Validate
{
protected $rule = [
'account_id|微信绑定' => 'require|gt:0',
'phone|手机号' => 'require|mobile',
'name|姓名' => 'require|chs',
'dept_name|所属部门' => 'max:200',
'account_roles' => 'max:300',
];
protected $scene = [
// 添加
'add' => ['account_id', 'phone', 'name', 'dept_name', 'account_roles'],
// 编辑
'edit' => ['phone', 'name', 'dept_name', 'account_roles'],
];
}