Browse Source

年假算法更改

laiguoran 6 years ago
parent
commit
f380bf4a86
1 changed files with 2 additions and 1 deletions
  1. 2 1
      protected/controller/HolidayController.php

+ 2 - 1
protected/controller/HolidayController.php

@@ -1101,13 +1101,14 @@ class HolidayController extends DooController {
 			return 0;
 		}
 		$hiredate = $staff['hiredate'];
+		$hireBiasDates = $staff['hireBiasDates'];
 		if($hiredate == ''){
 			return 0;
 		}
 		Doo::loadModel('holidaystaff');
 		$hstaff = new HStaff();
 		$hstaffmsg = $hstaff->getOne(array('where' => 'uid='.$staff['sid'],'asArray' => TRUE));
-		$hadyear = intval((time()-strtotime($hiredate))/(86400*365));
+		$hadyear = intval((time()-strtotime($hiredate) + 86400*$hireBiasDates)/(86400*365));
 		if($hadyear != $hstaffmsg['hadyear']){
 			$hstaff->uid = $staff['sid'];
 			$hstaff->hadyear = $hadyear;