Files
zyt/server/app/adminapi/validate/finance/DeptPerformanceTargetValidate.php
T
2026-05-11 17:49:38 +08:00

33 lines
830 B
PHP
Executable File

<?php
declare(strict_types=1);
namespace app\adminapi\validate\finance;
use app\common\validate\BaseValidate;
class DeptPerformanceTargetValidate extends BaseValidate
{
protected $rule = [
'year_month' => 'require|regex:/^\d{4}-\d{2}$/',
'items' => 'require|array',
];
protected $message = [
'year_month.require' => '请选择月份',
'year_month.regex' => '月份格式须为 YYYY-MM',
'items.require' => '请提交目标数据',
'items.array' => '目标数据格式错误',
];
public function sceneMonthMatrix(): DeptPerformanceTargetValidate
{
return $this->only(['year_month']);
}
public function sceneBatchSave(): DeptPerformanceTargetValidate
{
return $this->only(['year_month', 'items']);
}
}