GoodsReviewsValidate.php 690 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\api\validate;
  3. use app\common\validate\BaseValidate;
  4. /**
  5. * GoodsReviews验证器
  6. * Class GoodsReviewsValidate
  7. * @package app\api\validate
  8. */
  9. class GoodsReviewsValidate extends BaseValidate
  10. {
  11. /**
  12. * 设置校验规则
  13. * @var string[]
  14. */
  15. protected $rule = [
  16. 'sn' => 'require',
  17. 'rating' => 'require',
  18. ];
  19. /**
  20. * 参数描述
  21. * @var string[]
  22. */
  23. protected $field = [
  24. 'sn' => '参数错误',
  25. 'rating' => '星级',
  26. ];
  27. /**
  28. * @notes 添加场景
  29. * @return GoodsValidate
  30. */
  31. public function sceneAdd()
  32. {
  33. return $this->only(['sn','rating']);
  34. }
  35. }