|
|
@@ -43,6 +43,15 @@ class StaffSalary extends Api
|
|
|
{
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
+ $startDate = $params['start_date'];
|
|
|
+ $endDate = $params['end_date'];
|
|
|
+ $attendanceMonth = $params['date'];
|
|
|
+ // 确保开始日期和结束日期在考勤年月的范围内
|
|
|
+ $startDateInRange = date('Ym', strtotime($startDate)) === $attendanceMonth;
|
|
|
+ $endDateInRange = date('Ym', strtotime($endDate)) === $attendanceMonth;
|
|
|
+ if (!$startDateInRange || !$endDateInRange) {
|
|
|
+ $this->error('日期参数错误');
|
|
|
+ }
|
|
|
$vacationOneArr = [];
|
|
|
if (!empty($params['vacation_one_start']) && !empty($params['vacation_one_end'])){
|
|
|
$vacationOneStart = strtotime($params['vacation_one_start']);
|
|
|
@@ -61,8 +70,11 @@ class StaffSalary extends Api
|
|
|
array_push($vacationTwoArr,date("Y-m-d", $i));
|
|
|
}
|
|
|
}
|
|
|
- $startDate = $params['start_date'];
|
|
|
- $endDate = $params['end_date'];
|
|
|
+ //法定天数
|
|
|
+ $clocking_in_day = \db('人事_考勤资料')->where('kqzl_ny',$params['date'])->field('法定天数')->order('UniqId desc')->find();
|
|
|
+ if (!empty($clocking_in_day)){
|
|
|
+ $params['days'] = (int)$clocking_in_day['法定天数'];
|
|
|
+ }
|
|
|
//将起止日期内数据删除
|
|
|
$delRes = \db('绩效工资汇总')->where('sczl_rq','between',[$startDate,$endDate])->delete();
|
|
|
$where = [];
|