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.

48 lines
1.1 KiB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request;
  4. use Hyperf\Validation\Request\FormRequest;
  5. class CouponRebateTieRequest 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. 'coupon_activity' => 'required|nonempty',
  21. 'coupon_forward_ids' => 'required|nonempty',
  22. 'coupon_repay_id' => 'required|nonempty',
  23. ];
  24. }
  25. public function messages(): array
  26. {
  27. return [
  28. 'coupon_activity.*' => ':attribute必须',
  29. 'coupon_forward_ids.*' => ':attribute必须',
  30. 'coupon_repay_id.*' => ':attribute必须',
  31. ];
  32. }
  33. public function attributes(): array
  34. {
  35. return [
  36. 'coupon_activity' => '优惠券活动',
  37. 'coupon_forward_ids' => '领取类型优惠券',
  38. 'coupon_repay_id' => '返还类型优惠券',
  39. ];
  40. }
  41. }