dev_oa/app/home/validate/InvoiceCheck.php

26 lines
820 B
PHP
Raw Normal View History

2021-11-17 16:20:00 +08:00
<?php
namespace app\home\validate;
use think\Validate;
class InvoiceCheck extends Validate
{
protected $rule = [
2021-11-20 00:15:42 +08:00
'amount' => 'require|float',
'invoice_type' => 'require',
'invoice_subject' => 'require',
'id' => 'require'
2021-11-17 16:20:00 +08:00
];
protected $message = [
2021-11-20 00:15:42 +08:00
'amount.require' => '开票金额不能为空',
'amount.number' => '开票金额只能为数字',
2021-11-17 16:20:00 +08:00
'id.require' => '缺少更新条件',
2021-11-20 00:15:42 +08:00
'invoice_type.require' => '请选择开票类型',
'invoice_subject.require' => '请选择开票主体',
2021-11-17 16:20:00 +08:00
];
protected $scene = [
2021-11-20 00:15:42 +08:00
'add' => ['amount','invoice_type','invoice_subject'],
'edit' => ['id', 'amount','invoice_type','invoice_subject']
2021-11-17 16:20:00 +08:00
];
}