| 
					
				 | 
			
			
				@@ -141,7 +141,30 @@ class TalentBasicChange extends EnterpriseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["enterprise_id", "=", $this->user["uid"]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["id", "not in", $changes]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["checkState", "=", \app\common\api\TalentState::CERTIFICATED]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $twiceIdentifyPersons = \app\common\api\VerifyApi::getTwiceIdentifyPersons(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($twiceIdentifyPersons) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $_whr = $where; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $where[] = ["card_number", "not in", $twiceIdentifyPersons]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $_whr[] = ["card_number", "in", $twiceIdentifyPersons]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $tmpList = \app\enterprise\model\Talent::where($_whr)->field("id,name")->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $twiceIdentifyPersonList = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                foreach ($tmpList as $person) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (!$twiceIdentifyPersonList[$person["card_number"]]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $twiceIdentifyPersonList[$person["card_number"]] = $person; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ($person["talent_arrange"] < $twiceIdentifyPersonList[$person["card_number"]]["talent_arrange"]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $twiceIdentifyPersonList[$person["card_number"]] = $person; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sort($twiceIdentifyPersonList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $list = \app\enterprise\model\Talent::where($where)->field("id,name")->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($twiceIdentifyPersonList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $list = array_merge($twiceIdentifyPersonList, (array) $list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $assigns["list"] = $list; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $assigns["type"] = $this->user["type"]; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -322,11 +345,11 @@ class TalentBasicChange extends EnterpriseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $response; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function htindex(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function htindex() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return view("", ["type" => $this->user["type"]]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function htEndList(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function htEndList() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $offset = trim($this->request->param("offset")) ?: 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $limit = trim($this->request->param("limit")) ?: 10; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $name = trim($this->request->param("name")); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -347,18 +370,18 @@ class TalentBasicChange extends EnterpriseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //dump($where);die; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $now = date("Y-m-d",time()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $now = date("Y-m-d", time()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //$where[] = ["trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3))", "<", $now]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $count = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->count(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $list = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->limit($offset, $limit)->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $count = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc", "ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->count(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $list = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc", "ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->limit($offset, $limit)->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //echo Talent::getLastSql();die; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return json(["total" => $count, "rows" => $list]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function htEndExport(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function htEndExport() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where[] = ["ti.delete", "=", 0]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where[] = ["ti.active", "=", 1]; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -366,10 +389,10 @@ class TalentBasicChange extends EnterpriseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (session("user")["usertype"] == 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["ti.enterprise_id", "=", session("user")["uid"]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $now = date("Y-m-d",time()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $count = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->count(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $now = date("Y-m-d", time()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $count = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc", "ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->count(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if($count > 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($count > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $columns = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 '姓名', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 '证件号码', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -378,20 +401,20 @@ class TalentBasicChange extends EnterpriseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $setting = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $setting["freeze"] = "A2"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $setting["filter"] = sprintf("A1:%s1", getExcelColumnByIndex(count($columns) - 1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $lists = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $lists = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc", "ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $datas = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            foreach ($lists as $v){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            foreach ($lists as $v) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $item = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $v['name'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $v['card_number'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $v['labor_contract_rangetime'] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                array_push($datas,$item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                array_push($datas, $item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             export($columns, $datas, "合同到期列表导出", $setting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             echo "<script>parent.layer.alert('没有可以导出的数据');window.history.go(-1);</script>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |