0
0

Org.php 446 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class Org extends Validate{
  5. protected $rule = [
  6. 'name|名称' => 'require|length:1,100',
  7. 'parent_id' => 'require|gt:0',
  8. 'type' => 'require|in:1,2',
  9. ];
  10. protected $message = [
  11. 'title.length' => '名称必须100字以内',
  12. ];
  13. protected $scene = [
  14. 'add' => ['name','parent_id','type'],
  15. 'edit' => ['name']
  16. ];
  17. }