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.
46 lines
1.7 KiB
46 lines
1.7 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\validate\contract;
|
|
|
|
use core\base\BaseValidate;
|
|
|
|
/**
|
|
* 合同分发验证器
|
|
* Class ContractDistribution
|
|
* @package app\validate\contract
|
|
*/
|
|
class ContractDistribution extends BaseValidate
|
|
{
|
|
protected $rule = [
|
|
'contract_id' => 'require|integer|gt:0',
|
|
'personnel_ids' => 'require|array',
|
|
'type' => 'require|in:1,2',
|
|
'distributions' => 'require|array'
|
|
];
|
|
|
|
protected $message = [
|
|
'contract_id.require' => '合同ID不能为空',
|
|
'contract_id.integer' => '合同ID必须为整数',
|
|
'contract_id.gt' => '合同ID必须大于0',
|
|
'personnel_ids.require' => '人员列表不能为空',
|
|
'personnel_ids.array' => '人员列表必须为数组格式',
|
|
'type.require' => '人员类型不能为空',
|
|
'type.in' => '人员类型必须为1(内部员工)或2(外部会员)',
|
|
'distributions.require' => '分发配置不能为空',
|
|
'distributions.array' => '分发配置必须为数组格式'
|
|
];
|
|
|
|
protected $scene = [
|
|
'manualDistribute' => ['contract_id', 'personnel_ids', 'type'],
|
|
'batchDistribute' => ['distributions']
|
|
];
|
|
}
|
|
|