|
@@ -358,4 +358,28 @@ class TalentBasicChange extends EnterpriseController {
|
|
|
return json(["total" => $count, "rows" => $list]);
|
|
|
}
|
|
|
|
|
|
+ public function htEndExport(){
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["ti.delete", "=", 0];
|
|
|
+ $where[] = ["ti.active", "=", 1];
|
|
|
+ $where[] = ["ti.checkState", "=", TalentState::CERTIFICATED];
|
|
|
+ $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){
|
|
|
+ $columns = [
|
|
|
+ 'id',
|
|
|
+ '姓名',
|
|
|
+ '证件号码',
|
|
|
+ '劳动合同时间'
|
|
|
+ ];
|
|
|
+ $setting = [];
|
|
|
+ $setting["freeze"] = "A2";
|
|
|
+ $setting["filter"] = sprintf("A1:%s1", getExcelColumnByIndex(count($columns) - 1));
|
|
|
+ $datas = 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();
|
|
|
+ export($columns, $datas, "合同到期列表导出", $setting);
|
|
|
+ }else{
|
|
|
+ echo "<script>parent.layer.alert('没有可以导出的数据');window.history.go(-1);</script>";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|