BasicPanel.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace App\Http\Requests\Manager\Statistics;
  3. use App\Http\Requests\BaseRequest;
  4. /**
  5. * 报表统计-概览面板
  6. * @author 唐远望
  7. * @version 1.0
  8. * @date 2026-02-10
  9. *
  10. */
  11. class BasicPanel 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',
  25. 'page' => 'integer|min:1',
  26. 'limit' => 'integer|min:1',
  27. 'image_url' => 'required',
  28. 'link_url' => 'required',
  29. 'sort' => 'required|integer|min:0',
  30. ];
  31. }
  32. // 场景列表
  33. protected $scenes = [
  34. 'detail' => ['id'],
  35. 'list' => ['page', 'limit'],
  36. 'add' => [''],
  37. 'edit' => [''],
  38. 'set_status' => ['id', 'status'],
  39. 'delete' => ['id'],
  40. 'data_cleaning' => [''],
  41. 'export_excel' => [''],
  42. 'get_online_goods_count' => [],
  43. 'get_violation_product_count' => ['page','limit'],
  44. 'get_violation_company_count' => ['page','limit'],
  45. 'get_low_price_product_count' => ['page','limit'],
  46. 'get_low_price_company_count' => ['page','limit'],
  47. 'get_violation_province_count' => [],
  48. 'get_violation_city_count' => [],
  49. 'get_low_price_province_count' => [],
  50. 'get_low_price_city_count' => [],
  51. 'get_low_price_platform_count' => [],
  52. 'get_low_price_platform_province_count' => [],
  53. 'get_violation_platform_count' =>[],
  54. 'get_violation_platform_province_count' =>[],
  55. ];
  56. /**
  57. * 获取已定义验证规则的错误消息
  58. *
  59. * @return array
  60. */
  61. public function messages()
  62. {
  63. return [
  64. 'name.required' => '名称必填',
  65. 'id.required' => 'ID未知',
  66. 'id.integer' => 'ID格式错误',
  67. 'id.gt' => 'ID格式错误',
  68. 'status.required' => '状态未知',
  69. 'status.integer' => '状态格式错误',
  70. 'status.in' => '状态格式错误',
  71. 'page.integer' => '页码格式错误',
  72. 'page.min' => '页码格式错误',
  73. 'limit.integer' => '每页数量格式错误',
  74. 'limit.min' => '每页数量格式错误',
  75. 'image_url.required' => '图片链接未知',
  76. 'link_url.required' => '链接地址未知',
  77. 'sort.required' => '排序未知',
  78. 'sort.integer' => '排序格式错误',
  79. 'sort.min' => '排序格式错误',
  80. ];
  81. }
  82. }