CategoryValidate.php 932 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\admin\validate\sys_manage;
  3. use think\Validate;
  4. class CategoryValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'category_name' => 'require|chsDash',
  8. 'category_super_id' => 'integer',
  9. 'category_status' => 'require|in:PENDING,ACTIVED,DISABLED',
  10. 'category_classify' => 'chsDash',
  11. 'category_type' => 'chsDash',
  12. 'category_sort' => 'integer',
  13. 'category_groupby' => 'chsDash',
  14. 'category_remark' => 'chsDash'
  15. ];
  16. protected $message = [];
  17. protected $scene = [
  18. 'add' => ['category_name', 'category_super_id', 'category_status', 'category_classify', 'category_type', 'category_sort', 'category_groupby', 'category_remark'],
  19. 'update' => ['category_name', 'category_super_id', 'category_classify', 'category_type', 'category_sort', 'category_groupby', 'category_remark'],
  20. 'update_status' => ['category_status']
  21. ];
  22. }