MoldValidate.php 561 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\admin\validate\life;
  3. use think\Validate;
  4. class MoldValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'mold_name' => 'require|max:20',
  8. 'mold_id' => 'require',
  9. 'mold_mold' => 'require',
  10. ];
  11. protected $message = [
  12. 'mold_id.require' => '类型ID不能为空',
  13. 'mold_name.require' => '类型名称不能为空',
  14. ];
  15. //场景
  16. protected $scene = [
  17. 'create' => ['mold_name'],
  18. 'update' => ['mold_id','mold_name'],
  19. 'info' => ['mold_id']
  20. ];
  21. }