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.

60 lines
1.7 KiB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request;
  4. use Hyperf\Validation\Request\FormRequest;
  5. class EvaluateRequest 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. 'c_attitude' => 'required|nonempty|integer',
  21. 'c_service' => 'required|nonempty|integer',
  22. 'c_quality' => 'required|nonempty|integer',
  23. 'content' => 'required|nonempty|between:15,150',
  24. 'user_id' => 'required|nonempty|integer',
  25. 'service_personnel_id' => 'required|nonempty|integer',
  26. 'market_id' => 'required|nonempty|integer',
  27. ];
  28. }
  29. public function messages(): array
  30. {
  31. return [
  32. 'user_id.*' => ':attribute信息不正确',
  33. 'service_personnel_id.*' => ':attribute信息不正确',
  34. 'market_id.*' => ':attribute信息不正确',
  35. 'c_attitude.*' => ':attribute信息不正确',
  36. 'c_service.*' => ':attribute信息不正确',
  37. 'c_quality.*' => ':attribute信息不正确',
  38. 'content.*' => ':attribute信息不正确',
  39. ];
  40. }
  41. public function attributes(): array
  42. {
  43. return [
  44. 'user_id' => '用户',
  45. 'service_personnel_id' => '服务专员',
  46. 'market_id' => '服务专员市场',
  47. 'c_attitude' => '服务态度评分',
  48. 'c_service' => '服务值评分',
  49. 'c_quality' => '服务质量评分',
  50. 'content' => '服务评价',
  51. ];
  52. }
  53. }