BasicPanel.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. ];
  52. /**
  53. * 获取已定义验证规则的错误消息
  54. *
  55. * @return array
  56. */
  57. public function messages()
  58. {
  59. return [
  60. 'name.required' => '名称必填',
  61. 'id.required' => 'ID未知',
  62. 'id.integer' => 'ID格式错误',
  63. 'id.gt' => 'ID格式错误',
  64. 'status.required' => '状态未知',
  65. 'status.integer' => '状态格式错误',
  66. 'status.in' => '状态格式错误',
  67. 'page.integer' => '页码格式错误',
  68. 'page.min' => '页码格式错误',
  69. 'limit.integer' => '每页数量格式错误',
  70. 'limit.min' => '每页数量格式错误',
  71. 'image_url.required' => '图片链接未知',
  72. 'link_url.required' => '链接地址未知',
  73. 'sort.required' => '排序未知',
  74. 'sort.integer' => '排序格式错误',
  75. 'sort.min' => '排序格式错误',
  76. ];
  77. }
  78. }