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.

57 lines
2.1 KiB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request;
  4. use App\Request\BaseFormRequest;
  5. class WxminiPayRequest extends BaseFormRequest
  6. {
  7. /**
  8. * Get the validation rules that apply to the request.
  9. */
  10. public function rules(): array
  11. {
  12. return [
  13. 'c_attitude' => 'required|nonempty|integer',
  14. 'c_service' => 'required|nonempty|integer',
  15. 'c_quality' => 'required|nonempty|integer',
  16. 'content' => 'required|nonempty|strlen:15,150',
  17. 'user_id' => 'required|nonempty|integer|exists:ims_cjdc_user,id',
  18. 'service_personnel_id' => 'required|nonempty|integer|exists_enable:lanzu_service_personnel,id,status=1|not_equal:user_id,lanzu_service_personnel,id,user_id',
  19. 'market_id' => 'required|nonempty|integer|exists:ims_cjdc_market,id',
  20. ];
  21. }
  22. public function messages(): array
  23. {
  24. return [
  25. 'user_id.exists' => ':attribute不存在',
  26. 'service_personnel_id.exists' => ':attribute不存在',
  27. 'market_id.exists' => ':attribute不存在',
  28. 'user_id.*' => ':attribute信息不正确',
  29. 'service_personnel_id.exists_enable' => ':attribute不存在或被禁用',
  30. 'service_personnel_id.not_equal' => ':attribute不能是自己',
  31. 'service_personnel_id.*' => ':attribute信息不正确',
  32. 'market_id.*' => ':attribute信息不正确',
  33. 'c_attitude.*' => ':attribute信息不正确',
  34. 'c_service.*' => ':attribute信息不正确',
  35. 'c_quality.*' => ':attribute信息不正确',
  36. 'content.strlen' => ':attribute字数限制在:min~:max字',
  37. 'content.*' => ':attribute信息不正确',
  38. ];
  39. }
  40. public function attributes(): array
  41. {
  42. return [
  43. 'user_id' => '用户',
  44. 'service_personnel_id' => '服务专员',
  45. 'market_id' => '服务专员市场',
  46. 'c_attitude' => '服务态度评分',
  47. 'c_service' => '服务值评分',
  48. 'c_quality' => '服务质量评分',
  49. 'content' => '服务评价内容',
  50. ];
  51. }
  52. }