CustomFormStatistics.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Http\Requests\OpenWork\Statistics;
  3. use App\Http\Requests\BaseRequest;
  4. /**
  5. * 自定义表单统计校验规则
  6. * @author 唐远望
  7. * @date 2025-08-14
  8. * */
  9. class CustomFormStatistics extends BaseRequest
  10. {
  11. /**
  12. *
  13. * @return array
  14. */
  15. public function rules()
  16. {
  17. // 规则
  18. return [
  19. 'corpid' => 'required',
  20. 'limit' => 'integer',
  21. 'form_id' => 'required|integer',
  22. 'id' => 'required|integer',
  23. ];
  24. }
  25. // 场景列表
  26. protected $scenes = [
  27. 'overview' => ['corpid','form_id'],
  28. 'detail' => ['corpid','form_id'],
  29. 'user_form_list' => ['corpid','form_id'],
  30. 'user_form_detail' => ['corpid','form_id','id'],
  31. ];
  32. /**
  33. *
  34. * @return array
  35. */
  36. public function messages()
  37. {
  38. return [
  39. 'corpid.required' => '授权方corpid不能为空',
  40. 'limit.integer' => '每页记录数必须为整数',
  41. 'form_id.required' => '表单id不能为空',
  42. 'form_id.integer' => '表单id必须为整数',
  43. 'id.required' => '记录id不能为空',
  44. 'id.integer' => '记录id必须为整数',
  45. ];
  46. }
  47. }