|
|
<?php
declare(strict_types=1);
namespace App\Request;
use Hyperf\Validation\Request\FormRequest;
class StoreApplyEntryRequest 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 [ 'name' => 'required|nonempty', 'market_id' => 'required|nonempty|integer', 'md_type' => 'required|nonempty|integer', 'address' => 'required|nonempty', 'coordinates' => 'required|nonempty', 'details' => 'required|nonempty', 'link_name' => 'required|nonempty', 'link_tel' => 'required|nonempty|tel', 'logo' => 'required|nonempty|image_if_file', 'fm_img' => 'required|nonempty|image_if_file|file_different_if_file:zm_img', 'zm_img' => 'required|nonempty|image_if_file|file_different_if_file:fm_img', 'yyzz' => 'required|nonempty|image_if_file', 'user_id' => 'required|nonempty|integer', 'rz_time' => 'required|nonempty|integer', 'mm_user_id' => 'nonempty|integer', 'id' => 'nonempty|integer', ]; }
public function messages(): array { return [ '*.nonempty' => ':attribute参数异常', 'logo.image' => ':attribute不是正常的图片', 'logo.*' => ':attribute未选择', 'fm_img.image' => ':attribute不是正常的图片', 'fm_img.file_different_if_file' => '身份证正反面不能相同', 'fm_img.*' => ':attribute未选择', 'zm_img.image' => ':attribute不是正常的图片', 'zm_img.file_different_if_file' => '身份证正反面不能相同', 'zm_img.*' => ':attribute未选择', 'yyzz.image' => ':attribute不是正常的图片', 'yyzz.*' => ':attribute未选择', 'link_tel.tel' => ':attribute格式不正确', ]; }
public function attributes(): array { return [ 'name' => '商户名', 'market_id' => '市场ID', 'md_type' => '门店类型', 'address' => '门店地址', 'coordinates' => '门店经纬度', 'details' => '门店简介', 'link_name' => '联系人姓名', 'link_tel' => '联系人电话', 'logo' => '商户LOGO', 'fm_img' => '商户身份证反面', 'zm_img' => '商户身份证正面', 'yyzz' => '商户营业执照', 'user_id' => '申请用户ID', 'rz_time' => '入驻天数', 'mm_user_id' => '市场经理用户ID', 'id' => '门店ID', ]; }}
|