3 changed files with 140 additions and 0 deletions
-
1app/Controller/CouponController.php
-
91app/Controller/CouponRebateController.php
-
48app/Request/couponRebateReceiveRequest.php
@ -0,0 +1,48 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
namespace App\Request; |
|||
|
|||
use Hyperf\Validation\Request\FormRequest; |
|||
|
|||
class CouponRebateReceiveRequest extends FormRequest |
|||
{ |
|||
/** |
|||
* Determine if the user is authorized to make this request. |
|||
*/ |
|||
public function authorize(): bool |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* Get the validation rules that apply to the request. |
|||
*/ |
|||
public function rules(): array |
|||
{ |
|||
return [ |
|||
'user_id' => 'required|nonempty|integer|exists_enable:ims_cjdc_user,id', |
|||
'receive_type' => 'required|nonempty|integer', |
|||
'ids' => 'required|nonempty', |
|||
]; |
|||
} |
|||
|
|||
public function messages(): array |
|||
{ |
|||
return [ |
|||
'user_id.*' => ':attribute信息不正确', |
|||
'receive_type.*' => ':attribute必须', |
|||
'ids.*' => ':attribute必须', |
|||
]; |
|||
} |
|||
|
|||
public function attributes(): array |
|||
{ |
|||
return [ |
|||
'user_id' => '领取用户ID', |
|||
'receive_type' => '领取方式', |
|||
'ids' => '优惠券', |
|||
]; |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue