|
@@ -363,11 +363,14 @@ class TalentBasicChange extends EnterpriseController {
|
|
|
$where[] = ["ti.delete", "=", 0];
|
|
|
$where[] = ["ti.active", "=", 1];
|
|
|
$where[] = ["ti.checkState", "=", TalentState::CERTIFICATED];
|
|
|
+ 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();
|
|
|
+
|
|
|
if($count > 0){
|
|
|
$columns = [
|
|
|
- 'id',
|
|
|
'姓名',
|
|
|
'证件号码',
|
|
|
'劳动合同时间'
|
|
@@ -375,7 +378,16 @@ class TalentBasicChange extends EnterpriseController {
|
|
|
$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")->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){
|
|
|
+ $item = [
|
|
|
+ $v['name'],
|
|
|
+ $v['card_number'],
|
|
|
+ $v['labor_contract_rangetime']
|
|
|
+ ];
|
|
|
+ array_push($datas,$item);
|
|
|
+ }
|
|
|
export($columns, $datas, "合同到期列表导出", $setting);
|
|
|
}else{
|
|
|
echo "<script>parent.layer.alert('没有可以导出的数据');window.history.go(-1);</script>";
|