56 lines
2.4 KiB
PHP
56 lines
2.4 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace app\common\validate;
|
||
|
|
|
||
|
|
use think\Validate;
|
||
|
|
|
||
|
|
class FinReceiptValidate extends Validate
|
||
|
|
{
|
||
|
|
// 规则
|
||
|
|
protected $rule = [
|
||
|
|
'payment_apply_id' => 'integer|gt:0',
|
||
|
|
'country_id' => 'require|integer|gt:0',
|
||
|
|
'remitter' => 'require',
|
||
|
|
'account_id' => 'require|integer|gt:0',
|
||
|
|
'currency_id' => 'require|integer|gt:0',
|
||
|
|
'amount' => 'require|gt:0',
|
||
|
|
'exchange_rate' => 'require|gt:0',
|
||
|
|
'arrived_at' => 'require',
|
||
|
|
'is_domestic_return' => 'require|integer',
|
||
|
|
];
|
||
|
|
|
||
|
|
// 提示
|
||
|
|
protected $message = [
|
||
|
|
'payment_apply_id.integer' => '付款申请ID必须是整数',
|
||
|
|
'payment_apply_id.gt' => '付款申请ID必须大于0',
|
||
|
|
'country_id.require' => '付款来源国家ID不能为空',
|
||
|
|
'country_id.integer' => '付款来源国家ID必须是整数',
|
||
|
|
'country_id.gt' => '付款来源国家ID必须大于0',
|
||
|
|
'remitter.require' => '汇款人不能为空',
|
||
|
|
'account_id.require' => '收款账号ID不能为空',
|
||
|
|
'account_id.integer' => '收款账号ID必须是整数',
|
||
|
|
'account_id.gt' => '收款账号ID必须大于0',
|
||
|
|
'currency_id.require' => '收款币种ID不能为空',
|
||
|
|
'currency_id.integer' => '收款币种ID必须是整数',
|
||
|
|
'currency_id.gt' => '收款币种ID必须大于0',
|
||
|
|
'amount.require' => '收款金额不能为空',
|
||
|
|
'amount.gt' => '收款金额必须大于0',
|
||
|
|
'exchange_rate.require' => '实际汇率不能为空',
|
||
|
|
'exchange_rate.gt' => '实际汇率必须大于0',
|
||
|
|
'arrived_at.require' => '到账时间不能为空',
|
||
|
|
'arrived_at.gt' => '到账时间必须大于0',
|
||
|
|
'is_domestic_return.require' => '是否回转内地不能为空',
|
||
|
|
'is_domestic_return.integer' => '是否回转内地必须是整数',
|
||
|
|
];
|
||
|
|
|
||
|
|
// 场景
|
||
|
|
protected $scene = [
|
||
|
|
'store' => [
|
||
|
|
'payment_apply_id', 'country_id', 'remitter', 'account_id', 'currency_id', 'amount', 'exchange_rate', 'arrived_at'
|
||
|
|
],
|
||
|
|
|
||
|
|
'update' => [
|
||
|
|
|
||
|
|
]
|
||
|
|
];
|
||
|
|
}
|