MedicalCareProductAttrValidate.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\admin\validate\medical;
  3. use think\Validate;
  4. class MedicalCareProductAttrValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'attr_product_id' => 'require',
  8. 'attr_name' => 'require',
  9. 'attr_values' => 'require',
  10. 'attr_type' => 'require',
  11. 'attr_id' => 'require',
  12. ];
  13. protected $message = [
  14. 'attr_id.require' => 'ID不能为空',
  15. 'attr_product_id.require' => '所属产品能为空',
  16. 'attr_name.require' => '属性名称不能为空',
  17. 'attr_values.require' => '属性值不能为空',
  18. 'attr_type.require' => '产品类型不能为空',
  19. ];
  20. //场景
  21. protected $scene = [
  22. 'add' => [
  23. 'attr_product_id','attr_name','attr_values',
  24. 'attr_type'
  25. ],
  26. 'update' => [
  27. 'attr_product_id','attr_name','attr_values',
  28. 'attr_type'
  29. ],
  30. 'info' => ['product_id'],
  31. 'del' => ['product_id']
  32. ];
  33. }