|
@@ -1,7 +1,7 @@
|
|
|
<?php
|
|
|
|
|
|
/**
|
|
|
- * @author darkredz
|
|
|
+ * @author ellisRan
|
|
|
*/
|
|
|
|
|
|
class HolidayController extends DooController {
|
|
@@ -94,7 +94,7 @@ class HolidayController extends DooController {
|
|
|
$data['sangjianum'] = floatval($hstaffmsg['sangjianum']);
|
|
|
$data['gongjianum'] = floatval($hstaffmsg['gongjianum']);
|
|
|
|
|
|
- $data['yearround'] = $this->getYearRoundtime($hstaffmsg['hadyear'],$this->staff[0]['hiredate']);
|
|
|
+ $data['yearround'] = $this->getYearRoundtime($hstaffmsg['hadyear'],$this->staff[0]['hiredate'],$this->staff[0]['hireBiasDate']);
|
|
|
|
|
|
// var_dump($holidaymsg);
|
|
|
// exit;
|
|
@@ -804,7 +804,7 @@ class HolidayController extends DooController {
|
|
|
$cidstafflist[$ck]['chanjianum'] = $hstaffmsg['chanjianum'] != 0.0 ? floatval($hstaffmsg['chanjianum']) : '';
|
|
|
$cidstafflist[$ck]['sangjianum'] = $hstaffmsg['sangjianum'] != 0.0 ? floatval($hstaffmsg['sangjianum']) : '';
|
|
|
$cidstafflist[$ck]['gongjianum'] = $hstaffmsg['gongjianum'] != 0.0 ? floatval($hstaffmsg['gongjianum']) : '';
|
|
|
- $cidstafflist[$ck]['yearround'] = $cv['nature'] == 1 ? $this->getYearRoundtime($hstaffmsg['hadyear'],$cv['hiredate']) : '';
|
|
|
+ $cidstafflist[$ck]['yearround'] = $cv['nature'] == 1 ? $this->getYearRoundtime($hstaffmsg['hadyear'],$cv['hiredate'],$cv['hireBiasDate']) : '';
|
|
|
$cidstafflist[$ck]['first'] = $ck == 0 ? 1 : ''; // 是否第一个
|
|
|
}
|
|
|
$stafflist[0]['cidstafflist'] = $cidstafflist;
|
|
@@ -825,7 +825,7 @@ class HolidayController extends DooController {
|
|
|
$cidstafflist[$ck]['chanjianum'] = $hstaffmsg['chanjianum'] != 0.0 ? floatval($hstaffmsg['chanjianum']) : '';
|
|
|
$cidstafflist[$ck]['sangjianum'] = $hstaffmsg['sangjianum'] != 0.0 ? floatval($hstaffmsg['sangjianum']) : '';
|
|
|
$cidstafflist[$ck]['gongjianum'] = $hstaffmsg['gongjianum'] != 0.0 ? floatval($hstaffmsg['gongjianum']) : '';
|
|
|
- $cidstafflist[$ck]['yearround'] = $cv['nature'] == 1 ? $this->getYearRoundtime($hstaffmsg['hadyear'],$cv['hiredate']) : '';
|
|
|
+ $cidstafflist[$ck]['yearround'] = $cv['nature'] == 1 ? $this->getYearRoundtime($hstaffmsg['hadyear'],$cv['hiredate'],$cv['hireBiasDate']) : '';
|
|
|
$cidstafflist[$ck]['first'] = $ck == 0 ? 1 : ''; // 是否第一个
|
|
|
}
|
|
|
$stafflist[$k]['cidstafflist'] = $cidstafflist;
|
|
@@ -1069,13 +1069,15 @@ class HolidayController extends DooController {
|
|
|
}
|
|
|
|
|
|
//获取本年当事人的年假周期
|
|
|
- private function getYearRoundtime($hadyear,$hiredate){
|
|
|
- $month = date('m', strtotime($hiredate));
|
|
|
- $date = date('d', strtotime($hiredate));
|
|
|
+ private function getYearRoundtime($hadyear,$hiredate,$hireBiasDate){
|
|
|
+ // 新算法,算出最新入职日期-前入职时间之和天数为年假周期的月日
|
|
|
+ $hireRound = strtotime($hiredate) - $hireBiasDate*86400;
|
|
|
+ $month = date('m', $hireRound);
|
|
|
+ $date = date('d', $hireRound);
|
|
|
$monthday = intval($month).'月'.intval($date).'日';
|
|
|
$year = date('Y',time());
|
|
|
//每隔4年加一天
|
|
|
- if(date('Y',(strtotime($hiredate)+(86400*365*$hadyear)+intval($hadyear/4)*86400)) < $year){
|
|
|
+ if(date('Y',($hireRound+(86400*365*$hadyear)+intval($hadyear/4)*86400)) < $year){
|
|
|
$lastyear = intval($year)-1;
|
|
|
return intval($lastyear).'年'.$monthday.'~'.intval($year).'年'.$monthday;
|
|
|
}else{
|