You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.8 KiB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request;
  4. use Hyperf\Validation\Request\FormRequest;
  5. class StoreApplyEntryRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. */
  10. public function authorize(): bool
  11. {
  12. return true;
  13. }
  14. /**
  15. * Get the validation rules that apply to the request.
  16. */
  17. public function rules(): array
  18. {
  19. return [
  20. 'name' => 'required|nonempty',
  21. 'market_id' => 'required|nonempty|integer',
  22. 'md_type' => 'required|nonempty|integer',
  23. 'address' => 'required|nonempty',
  24. 'coordinates' => 'required|nonempty',
  25. 'details' => 'required|nonempty',
  26. 'link_name' => 'required|nonempty',
  27. 'link_tel' => 'required|nonempty|tel',
  28. 'logo' => 'required|nonempty|image_if_file',
  29. 'fm_img' => 'required|nonempty|image_if_file|file_different_if_file:zm_img',
  30. 'zm_img' => 'required|nonempty|image_if_file|file_different_if_file:fm_img',
  31. 'yyzz' => 'required|nonempty|image_if_file',
  32. 'user_id' => 'required|nonempty|integer',
  33. 'rz_time' => 'required|nonempty|integer',
  34. 'mm_user_id' => 'nonempty|integer',
  35. 'id' => 'nonempty|integer',
  36. ];
  37. }
  38. public function messages(): array
  39. {
  40. return [
  41. '*.nonempty' => ':attribute参数异常',
  42. 'logo.image' => ':attribute不是正常的图片',
  43. 'logo.*' => ':attribute未选择',
  44. 'fm_img.image' => ':attribute不是正常的图片',
  45. 'fm_img.file_different_if_file' => '身份证正反面不能相同',
  46. 'fm_img.*' => ':attribute未选择',
  47. 'zm_img.image' => ':attribute不是正常的图片',
  48. 'zm_img.file_different_if_file' => '身份证正反面不能相同',
  49. 'zm_img.*' => ':attribute未选择',
  50. 'yyzz.image' => ':attribute不是正常的图片',
  51. 'yyzz.*' => ':attribute未选择',
  52. 'link_tel.tel' => ':attribute格式不正确',
  53. ];
  54. }
  55. public function attributes(): array
  56. {
  57. return [
  58. 'name' => '商户名',
  59. 'market_id' => '市场ID',
  60. 'md_type' => '门店类型',
  61. 'address' => '门店地址',
  62. 'coordinates' => '门店经纬度',
  63. 'details' => '门店简介',
  64. 'link_name' => '联系人姓名',
  65. 'link_tel' => '联系人电话',
  66. 'logo' => '商户LOGO',
  67. 'fm_img' => '商户身份证反面',
  68. 'zm_img' => '商户身份证正面',
  69. 'yyzz' => '商户营业执照',
  70. 'user_id' => '申请用户ID',
  71. 'rz_time' => '入驻天数',
  72. 'mm_user_id' => '市场经理用户ID',
  73. 'id' => '门店ID',
  74. ];
  75. }
  76. }