BasicPanel.php 3.1 KB

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