Jelajahi Sumber

建筑激活功能

laiguoran 6 tahun lalu
induk
melakukan
b6f44b3aaf

+ 32 - 0
protected/config/routes.conf.php

@@ -624,4 +624,36 @@ $route['*']['/holidayattendance/day/:day/cate/:cate/type/:type'] = array('Holida
 $route['*']['/holidayattendance/day/:day/cate/:cate/type/:type/page/:pindex'] = array('HolidayController', 'holidayAttendance');
 
 
+// 建筑-CLD接口
+$route['*']['/api/building/category/staff/:cid'] = array('BuildingApiController', 'categoryStaff');
+
+// 建筑激活码
+$route['*']['/building'] = array('BuildingController', 'index');
+//$route['*']['/building/compilation/:pid'] = array('BuildingController', 'index');
+//$route['*']['/building/year/:year'] = array('BuildingController', 'index');
+//$route['*']['/building/year/:year/month/:month'] = array('BuildingController', 'index');
+//$route['*']['/building/category/:cid'] = array('BuildingController', 'index');
+//$route['*']['/building/category/:cid/staff/:sid'] = array('BuildingController', 'index');
+//
+//$route['*']['/building/compilation/:pid/year/:year'] = array('BuildingController', 'index');
+//$route['*']['/building/compilation/:pid/year/:year/month/:month'] = array('BuildingController', 'index');
+//$route['*']['/building/compilation/:pid/year/:year/month/:month/category/:cid'] = array('BuildingController', 'index');
+//$route['*']['/building/compilation/:pid/year/:year/month/:month/category/:cid/staff/:sid'] = array('BuildingController', 'index');
+//$route['*']['/building/year/:year/category/:cid'] = array('BuildingController', 'index');
+//$route['*']['/building/year/:year/category/:cid/staff/:sid'] = array('BuildingController', 'index');
+//$route['*']['/building/year/:year/month/:month/category/:cid'] = array('BuildingController', 'index');
+//$route['*']['/building/year/:year/month/:month/category/:cid/staff/:sid'] = array('BuildingController', 'index');
+//$route['*']['/building/compilation/:pid/category/:cid'] = array('BuildingController', 'index');
+//$route['*']['/building/compilation/:pid/category/:cid/staff/:sid'] = array('BuildingController', 'index');
+
+// 建筑页面ajax接口
+$route['*']['/building/getStaffMsg'] = array('BuildingController', 'getStaffMsg');
+$route['*']['/building/getBuildMsg'] = array('BuildingController', 'getBuildMsg');
+$route['*']['/building/getClientMsg'] = array('BuildingController', 'getClientMsg');
+$route['*']['/building/checkMobile'] = array('BuildingController', 'checkMobile');
+$route['*']['/building/getBuildList'] = array('BuildingController', 'getBuildList');
+
+$route['*']['/building/setUserCompilation'] = array('BuildingController', 'setUserCompilation');
+$route['*']['/building/setUserClient'] = array('BuildingController', 'setUserClient');
+
 ?>

+ 10 - 8
protected/controller/HolidayController.php

@@ -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{

+ 4 - 0
protected/model/client.php

@@ -101,6 +101,10 @@ class client extends DooModel {
 		
 		return $result;
     }
+
+    function getClientByID($id){
+        return $this->getOne ( array ('where' => "cid=?", 'param' => array($id), 'asArray' => TRUE ) );
+    }
     
 }
 

+ 16 - 2
protected/model/staff.php

@@ -21,6 +21,7 @@ class staff extends DooModel {
 	public $avatar;
 	public $appDate;
 	public $hiredate;
+	public $hireBiasDate;
 	public $wxid;
 	public $wecat;
 	public $nature;
@@ -108,6 +109,7 @@ class staff extends DooModel {
 			'email',
 			'avatar',
 			'hiredate',
+			'hireBiasDate',
 			'wxid',
 			'nature',
 			'remittanceName',
@@ -271,14 +273,14 @@ class staff extends DooModel {
 		$list = $this->find ( array (
 				'asc' => 'sid',
 				'where' => "cid= '" . $cid . "'",
-				'asArray' => TRUE 
+				'asArray' => TRUE
 		) );
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['sidKey'] = $XDeode->encode ( $value ['sid'] );
 		}
-		
+
 		return $list;
 	}
 	
@@ -462,6 +464,18 @@ class staff extends DooModel {
 				'asArray' => TRUE 
 		) );
 	}
+
+	// 建筑获取办事处人员部分信息
+	public function getStaffByCidOnBuilding($cid = 0) {
+		$list = $this->find ( array (
+			'select' => 'sid,username,cid,departmentID,category,qq,phone,telephone',
+			'asc' => 'sid',
+			'where' => "cid= '" . $cid . "'",
+			'asArray' => TRUE
+		) );
+
+		return $list;
+	}
 }
 
 ?>

+ 12 - 5
protected/view/menu.html

@@ -17,6 +17,10 @@
 </li>
 <!-- endif -->
 
+<li data-placement="right" data-toggle="ctooltip" data-original-title="建筑激活">
+    <a href="/building" class="icon- <!-- if {{memu}}=="building" --> selected <!-- endif -->">e</a>
+</li>
+
 <!-- if isShowMenu('RECEIPTS') -->
 <li  data-placement="right" data-toggle="ctooltip" class="topLine <!-- if   getGlobals('NEW') != 0 || getGlobals('NEW2') != 0  --> news <!-- endif -->" data-original-title="费用管理"  >
 <a href="/saeaBorad" class="icon- <!-- if {{memu}}=="receipt" --> selected <!-- endif -->" >U</a>
@@ -29,28 +33,31 @@
 </li>
 <!-- endif -->
 
+
 <!-- if isShowMenu('HR') -->
 <li data-placement="right" data-toggle="ctooltip" data-original-title="人资管理">
 <a href="/hr" class="icon- <!-- if {{memu}}=="HumanResource" --> selected <!-- endif -->">m</a>
 </li>
 <!-- endif -->
 
-<!-- if isShowMenu('EMAIL') -->
-<li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
-<a href="/eMailTask" class="icon- <!-- if {{memu}}=="eMailTask" --> selected <!-- endif -->">Z</a></li>
-<!-- endif -->
+
+
+
+
 
 <li data-placement="right" data-toggle="ctooltip" data-original-title="假期管理">
     <a href="/myList" class="icon- <!-- if {{memu}}=="holiday" --> selected <!-- endif -->">X</a>
 </li>
     
+<li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- <!-- if {{memu}}=="eMailTask" --> selected <!-- endif -->">Z</a></li>    
     
 <li data-placement="right" data-toggle="ctooltip" class="topLine" data-original-title="APP" >
 <a href="/app" class="icon- <!-- if {{memu}}=="app" --> selected <!-- endif -->">Y</a>
 </li>
 
 
-<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- <!-- if {{memu}}=="adminlock"||{{memu}}=="adminmyinfo"||{{memu}}=="adminoffice" --> selected <!-- endif -->" >F</a></li> 
+<li data-placement="right" style="display:none" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- <!-- if {{memu}}=="adminlock"||{{memu}}=="adminmyinfo"||{{memu}}=="adminoffice" --> selected <!-- endif -->" >F</a></li> 
 
 <li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" >
 <a href="/settingEmployeeInfo" class="icon- <!-- if {{memu}}=="adminlock"||{{memu}}=="adminmyinfo"||{{memu}}=="adminoffice" --> selected <!-- endif -->" >F</a>