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.
59 lines
2.2 KiB
59 lines
2.2 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\validate\salary;
|
|
|
|
use core\base\BaseValidate;
|
|
|
|
/**
|
|
* 工资条验证器
|
|
* Class Payroll
|
|
* @package app\adminapi\validate\salary
|
|
*/
|
|
class Payroll extends BaseValidate
|
|
{
|
|
protected $rule = [
|
|
'staff_id' => 'require|integer|gt:0',
|
|
'salary_month' => 'require|date',
|
|
'base_salary' => 'require|float|egt:0',
|
|
'full_attendance_days' => 'require|integer|between:1,31',
|
|
'attendance' => 'require|float|egt:0',
|
|
'mgr_performance' => 'float|egt:0',
|
|
'performance_bonus' => 'float|egt:0',
|
|
'other_subsidies' => 'float|egt:0',
|
|
'deductions' => 'float|egt:0',
|
|
'social_security' => 'float|egt:0',
|
|
'individual_income_tax' => 'float|egt:0'
|
|
];
|
|
|
|
protected $message = [
|
|
'staff_id.require' => '请选择员工',
|
|
'staff_id.gt' => '请选择有效的员工',
|
|
'salary_month.require' => '请选择工资月份',
|
|
'salary_month.date' => '工资月份格式不正确',
|
|
'base_salary.require' => '请输入基础工资',
|
|
'base_salary.egt' => '基础工资不能小于0',
|
|
'full_attendance_days.require' => '请输入满勤天数',
|
|
'full_attendance_days.between' => '满勤天数必须在1-31之间',
|
|
'attendance.require' => '请输入出勤天数',
|
|
'attendance.egt' => '出勤天数不能小于0'
|
|
];
|
|
|
|
protected $scene = [
|
|
'add' => ['staff_id', 'salary_month', 'base_salary', 'full_attendance_days', 'attendance'],
|
|
'edit' => ['staff_id', 'salary_month', 'base_salary', 'full_attendance_days', 'attendance']
|
|
];
|
|
|
|
public function sceneEdit()
|
|
{
|
|
return $this->append('id', 'require|integer|gt:0');
|
|
}
|
|
}
|