EarningsRecord.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace App\Http\Requests\Company\Promoter;
  3. use App\Http\Requests\BaseRequest;
  4. use Illuminate\Validation\Rule;
  5. /**
  6. * 推广员推广收益记录接口验证
  7. * @author 唐远望
  8. * @version 1.0
  9. * @date 2025-09-15
  10. *
  11. */
  12. class EarningsRecord extends BaseRequest
  13. {
  14. /**
  15. * 获取应用于请求的规则
  16. *
  17. * @return array
  18. */
  19. public function rules()
  20. {
  21. // 返回结果
  22. $rules = [
  23. 'name' => 'required',
  24. 'id' => 'required|integer|gt:0',
  25. 'page' => 'integer|min:1',
  26. 'limit' => 'integer|min:1',
  27. 'status ' => 'integer|in:0,1',
  28. 'promoter_userid' => 'required|integer|gt:0',
  29. 'audit_status' => 'integer|in:3,4',
  30. ];
  31. return $rules;
  32. }
  33. // 场景列表
  34. protected $scenes = [
  35. 'add' => [],
  36. 'list' => ['page', 'limit'],
  37. 'apply_list' => ['page', 'limit'],
  38. 'detail' => ['id'],
  39. 'set_status' => ['id', 'status'],
  40. 'audit' => ['id','audit_status'],
  41. 'export' =>[],
  42. 'audit_count' => [],
  43. ];
  44. /**
  45. * 获取已定义验证规则的错误消息
  46. *
  47. * @return array
  48. */
  49. public function messages()
  50. {
  51. return [
  52. 'name.required' => '名称必填',
  53. 'id.required' => 'ID未知',
  54. 'id.integer' => 'ID格式错误',
  55. 'id.gt' => 'ID格式错误',
  56. 'status.required' => '状态未知',
  57. 'status.integer' => '状态格式错误',
  58. 'status.in' => '状态格式错误',
  59. 'page.integer' => '页码格式错误',
  60. 'page.min' => '页码格式错误',
  61. 'limit.integer' => '每页数量格式错误',
  62. 'limit.min' => '每页数量格式错误',
  63. 'promoter_userid.required' => '推广员ID未知',
  64. 'promoter_userid.integer' => '推广员ID格式错误',
  65. 'promoter_userid.gt' => '推广员ID格式错误',
  66. 'audit_status.required' => '审核状态未知',
  67. 'audit_status.integer' => '审核状态格式错误',
  68. 'audit_status.in' => '审核状态格式错误',
  69. ];
  70. }
  71. }