ActiveUsers.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace App\Http\Requests\ReportStatistics\Reception;
  3. use App\Http\Requests\BaseRequest;
  4. /**
  5. * 活跃用户
  6. * @author 唐远望
  7. * @version 1.0
  8. * @date 2025-07-10
  9. *
  10. */
  11. class ActiveUsers extends BaseRequest
  12. {
  13. /**
  14. * 获取应用于请求的规则
  15. *
  16. * @return array
  17. */
  18. public function rules()
  19. {
  20. // 返回结果
  21. return [
  22. 'name' => 'required',
  23. 'id' => 'required|integer|gt:0',
  24. 'status' => 'required|integer|in:0,1,2,3',
  25. 'page' => 'integer|min:1',
  26. 'limit' => 'integer|min:1',
  27. 'company_id' => 'required|integer|gt:0',
  28. 'user_id' => 'required|integer|gt:0',
  29. ];
  30. }
  31. // 场景列表
  32. protected $scenes = [
  33. 'detail' => [],
  34. 'list' => ['page', 'limit'],
  35. 'add' => ['authcode','company_id'],
  36. 'delete' => ['id'],
  37. 'edit' =>[],
  38. 'get_statistics' => [],
  39. ];
  40. /**
  41. * 获取已定义验证规则的错误消息
  42. *
  43. * @return array
  44. */
  45. public function messages()
  46. {
  47. return [
  48. 'name.required' => '名称必填',
  49. 'id.required' => 'ID未知',
  50. 'id.integer' => 'ID格式错误',
  51. 'id.gt' => 'ID格式错误',
  52. 'status.required' => '状态未知',
  53. 'status.integer' => '状态格式错误',
  54. 'status.in' => '状态格式错误',
  55. 'page.integer' => '页码格式错误',
  56. 'page.min' => '页码格式错误',
  57. 'limit.integer' => '每页数量格式错误',
  58. 'limit.min' => '每页数量格式错误',
  59. ];
  60. }
  61. }