Insure.php 2.5 KB
<?php


namespace app\serviceapi\validate;


use app\common\validate\BaseValidate;

/**
 * Notes:功能描述 通用验证规则
 * User: 张佳
 * DateTime: 2020/7/15 11:02
 * Class Insure
 * @package app\serviceapi\validate
 */
class Insure extends BaseValidate
{
    protected $rule = [
        "utype" => "require",
        "org_code" => "require",
        "uid" => "require",
        'productCode' => 'require',
        'suiteCode' => 'require',
        'insBeginDate' => 'require',
        'insEndDate' => 'require',
        'chargeFreq' => 'require',
        'birthday' => 'require',
        'sex' => 'require',
        'age' => 'require',
        'socialFlag' => 'require',
        'adultFlag' => 'require',
        'totalPremiun' => 'require',
        'monthPremium' => 'require',
        'prevPremium' => 'require',
        'name' =>'require',
        'email'=>'require',
        'cardNo'=>'require',
        'mobile'=>'require'
    ];
    protected $message = [
        "utype.require" => "获取推广码的用户类型必须",
        "org_code.require" => "组织机构编码必须",
        "uid.require" => "用户id必须",
        'productCode.require' => '商品代码不能为空',
        'suiteCode.require' => '方案代码不能为空',
        'insBeginDate.require' => '保险起期不能为空',
        'insEndDate.require' => '保险止期不能为空',
        'chargeFreq.require' => '付费方式不能为空',
        'birthday.require' => '生日不能为空',
        'sex.require' => '性别不能为空',
        'age.require' => '年龄不能为空',
        'socialFlag.require' => '社保状态不能为空',
        'adultFlag.require' => '是否成年人不能为空',
        'totalPremiun' => '总保费不能为空',
        'monthPremium' => '次月保费不能为空',
        'prevPremium' => '标准保费不能为空',
        "name"=>'姓名不能为空',
        "email"=>'邮箱不能为空',
        "cardNo"=>'身份证号码不能为空',
        "mobile"=>'手机号码不能为空'
    ];
    protected $scene = [
        "get_promo_code" => ["utype", "org_code", "uid"],
        "pre_cal" => ["productCode","suiteCode","insBeginDate","insEndDate","chargeFreq"],
        "pre_cal_info" =>["sex","age","birthday"],
        "pre_cal_order" =>['totalPremiun','productCode','suiteCode','prevPremium','insBeginDate','insEndDate','chargeFreq','allPeriod','periods'],
        "pre_cal_holder" =>['name','email','cardNo','mobile'],
        "pre_cal_insured" =>['name','cardNo'],
        "intelligent"=>['productCode']
    ];

}