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.

51 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request\v3;
  4. use App\Request\BaseFormRequest;
  5. class OrderOnlineRequest extends BaseFormRequest
  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. 'market_id' => 'required|nonempty|integer',
  21. 'user_id' => 'required|nonempty|integer',
  22. 'user_address_id' => 'required_unless:self_take,1|nonempty|integer',
  23. 'store_list' => 'required|nonempty|json_keys:store_id,note,cart_ids',
  24. 'delivery_time_note' => 'required|nonempty',
  25. 'total_money' => 'required|nonempty',
  26. 'coupon_ids' => '',
  27. 'service_money' => 'numeric',
  28. 'plat' => '',
  29. 'self_take' => '',
  30. ];
  31. }
  32. public function messages(): array
  33. {
  34. return [
  35. '*.*' => ':attribute 参数异常'
  36. ];
  37. }
  38. public function attributes(): array
  39. {
  40. return [
  41. ];
  42. }
  43. }