nk-lihaink-cn/app/api/validate/Maintainentry.php
2023-01-19 02:36:01 +00:00

96 lines
3.2 KiB
PHP

<?php
namespace app\api\validate;
use think\Validate;
class Maintainentry extends Validate
{
/**
* 验证规则.
*/
protected $rule = [
'name' => 'require',
'gender' => 'require',
'gender_id' => 'require',
'age' => 'require|number|between:1,120',
'phone' => 'require|mobile',
'idcard' => 'require|idCard',
'captcha' => 'require',
'nation_id' => 'require',
// 'householder_id' => 'require',
'family_relation' => 'require',
'address_name' => 'require',
'marital_status' => 'require',
'marriage_id' => 'require',
'political_outlook' => 'require',
'zzmm_id' => 'require',
'nation' => 'require',
'area_id' => 'require',
'street_id' => 'require',
'village_id' => 'require',
'endowment_insurance_status_id'=>'require',
'insurance_type_id'=>'require',
'disability_type_id'=>'require',
'disability_level_id'=>'require',
'ny_insurance_id'=>'require',
'sy_insurance_id'=>'require',
];
/**
* 提示消息.
*/
protected $message = [
'name' => '请输入姓名',
'gender' => '请选择性别',
'gender_id' => '请选择性别',
'age' => '请输入年龄',
'age.between' => '年龄必须在1~120之间',
'age.number' => '年龄必须是数字',
'phone' => '请输入手机号',
'phone.mobile' => '手机号格式不正确',
'idcard' => '请输入身份证号',
'idcard.idCard' => '身份证号不正确',
'captcha' => '请输入验证码',
// 'householder_id' => 'require',
'family_relation' => '请选择家庭关系',
'address_name' => '请选择村组信息',
'marital_status' => '请选择婚姻状态',
'marriage_id' => '请选择婚姻状态',
'political_outlook' => '请选择政治面貌',
'zzmm_id' => '请选择政治面貌',
'nation' => '请选择民族',
'nation_id' => '请选择民族',
'area_id' => '请选择村组信息',
'street_id' => '请选择村组信息',
'village_id' => '请选择村组信息',
'endowment_insurance_status_id'=>'请选择养老保险状态',
'insurance_type_id'=>'请选择参保类型',
'disability_type_id'=>'请选择是否残疾',
'disability_level_id'=>'请选择残疾等级',
'ny_insurance_id'=>'请选择农业保险',
'sy_insurance_id'=>'请选择商业保险',
];
/**
* 字段描述.
*/
protected $field = [
];
/**
* 验证场景.
*/
protected $scene = [
'add' => ['name', 'gender_id', 'age', 'phone','idcard', 'marriage_id', 'zzmm_id', 'nation_id'],
'myadd' => ['name', 'gender_id', 'age', 'phone','idcard', 'marriage_id', 'zzmm_id', 'nation_id'],
'edit' => ['name', 'gender', 'age', 'phone','idcard', 'marriage_id', 'zzmm_id', 'nation_id'],
'insurancemsg' => ['endowment_insurance_status_id', 'insurance_type_id', 'disability_type_id','ny_insurance_id','sy_insurance_id'],
];
public function __construct()
{
parent::__construct();
}
}