|
@@ -53,7 +53,7 @@ class Talent extends EnterpriseController {
|
|
}
|
|
}
|
|
$param = $request->param();
|
|
$param = $request->param();
|
|
$id = isset($param["id"]) ? $param["id"] : 0;
|
|
$id = isset($param["id"]) ? $param["id"] : 0;
|
|
- $info = TalentApi::chkIsOwner($id, $this->user["uid"]);
|
|
|
|
|
|
+ $info = \app\common\api\VerifyApi::getTalentInfoById($id);
|
|
$ep = EnterpriseApi::getOne($this->user["uid"]);
|
|
$ep = EnterpriseApi::getOne($this->user["uid"]);
|
|
if (!chkEnterpriseFull($ep))
|
|
if (!chkEnterpriseFull($ep))
|
|
return;
|
|
return;
|
|
@@ -282,13 +282,9 @@ class Talent extends EnterpriseController {
|
|
private function submitToCheck_JJRC() {
|
|
private function submitToCheck_JJRC() {
|
|
$params = $this->request->param();
|
|
$params = $this->request->param();
|
|
$id = $params["id"];
|
|
$id = $params["id"];
|
|
- if (!$info = TalentApi::chkIsOwner($id, $this->user["uid"])) {
|
|
|
|
- $res = ["msg" => "没有对应的人才认定申报信息"];
|
|
|
|
- echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
|
|
|
|
- exit;
|
|
|
|
- }
|
|
|
|
|
|
+ $info = TalentApi::chkIsOwner($id, $this->user["uid"]);
|
|
$checkState = $info["checkState"];
|
|
$checkState = $info["checkState"];
|
|
- if ($checkState == TalentState::SCND_SAVE) {
|
|
|
|
|
|
+ if ($checkState == TalentState::SCND_SAVE || !$id) {
|
|
$field_dict = \app\common\api\DictApi::getTalentFields(4);
|
|
$field_dict = \app\common\api\DictApi::getTalentFields(4);
|
|
|
|
|
|
$no_empty = ["name", "nation", "card_type", "card_number", "sex", "birthday", "politics", "nationality", "province", "city", "county", "talent_type", "experience", "education",
|
|
$no_empty = ["name", "nation", "card_type", "card_number", "sex", "birthday", "politics", "nationality", "province", "city", "county", "talent_type", "experience", "education",
|
|
@@ -297,7 +293,6 @@ class Talent extends EnterpriseController {
|
|
|
|
|
|
$where = [];
|
|
$where = [];
|
|
$where[] = ["rel", "=", "study_abroad"];
|
|
$where[] = ["rel", "=", "study_abroad"];
|
|
- $where[] = ["step", "=", 2];
|
|
|
|
$where[] = ["project", "=", 1];
|
|
$where[] = ["project", "=", 1];
|
|
$where[] = ["active", "=", 1];
|
|
$where[] = ["active", "=", 1];
|
|
$where[] = ["delete", "=", 0];
|
|
$where[] = ["delete", "=", 0];
|
|
@@ -308,11 +303,11 @@ class Talent extends EnterpriseController {
|
|
if ($abroad_files)
|
|
if ($abroad_files)
|
|
$abroad_file_ids = array_column($abroad_files, "id");
|
|
$abroad_file_ids = array_column($abroad_files, "id");
|
|
|
|
|
|
- if (in_array($param["talent_type"], [1, 2])) {
|
|
|
|
|
|
+ if (in_array($params["talent_type"], [1, 2])) {
|
|
$no_empty[] = "tax_insurance_month";
|
|
$no_empty[] = "tax_insurance_month";
|
|
$no_empty[] = "labor_contract_rangetime";
|
|
$no_empty[] = "labor_contract_rangetime";
|
|
}
|
|
}
|
|
- if ($param["talent_type"] == 3) {
|
|
|
|
|
|
+ if ($params["talent_type"] == 3) {
|
|
$no_empty[] = "pre_import_type";
|
|
$no_empty[] = "pre_import_type";
|
|
}
|
|
}
|
|
if ($params["study_abroad"] == 1) {
|
|
if ($params["study_abroad"] == 1) {
|
|
@@ -370,7 +365,33 @@ class Talent extends EnterpriseController {
|
|
} else {
|
|
} else {
|
|
$filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
|
|
$filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
|
|
}
|
|
}
|
|
- $ft_ids = array_column($filetypes, "id");
|
|
|
|
|
|
+ $age = 0;
|
|
|
|
+ if ($params["birthday"]) {
|
|
|
|
+ $birthday = $params["birthday"];
|
|
|
|
+ $birthdayYear = substr($birthday, 0, 4);
|
|
|
|
+ $currentYear = date("Y");
|
|
|
|
+ $age = $currentYear - $birthdayYear;
|
|
|
|
+ }
|
|
|
|
+ $ft_ids = [];
|
|
|
|
+ $deletes = [];
|
|
|
|
+ foreach ($filetypes as $ft) {
|
|
|
|
+ if ($ft["option"]) {
|
|
|
|
+ if ($ft["rel"] == "birthday") {
|
|
|
|
+ if ($age < $ft["option"]) {
|
|
|
|
+ $deletes[] = $ft["id"];
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $selectVal = $params[$ft["rel"]];
|
|
|
|
+ $conditions = array_filter(explode(",", $ft["option"]));
|
|
|
|
+ if (!in_array($selectVal, $conditions)) {
|
|
|
|
+ $deletes[] = $ft["id"];
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $ft_ids[] = $ft["id"];
|
|
|
|
+ }
|
|
if ($params["study_abroad"] == 1) {
|
|
if ($params["study_abroad"] == 1) {
|
|
//选中留学,如果存在留学附件变成必传
|
|
//选中留学,如果存在留学附件变成必传
|
|
$ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
|
|
$ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
|
|
@@ -379,8 +400,13 @@ class Talent extends EnterpriseController {
|
|
$ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
|
|
$ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
|
|
}
|
|
}
|
|
$whr = [];
|
|
$whr = [];
|
|
|
|
+ if ($id) {
|
|
|
|
+ $whr[] = ["mainId", "=", $id];
|
|
|
|
+ } else {
|
|
|
|
+ if ($params["uploadFiles"])
|
|
|
|
+ $whr[] = ["id", "in", $params["uploadFiles"]];
|
|
|
|
+ }
|
|
$whr[] = ["typeId", "in", $ft_ids];
|
|
$whr[] = ["typeId", "in", $ft_ids];
|
|
- $whr[] = ["mainId", "=", $id];
|
|
|
|
$distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
|
|
$distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
|
|
$upload_type_counts = count($distinct_filetypes);
|
|
$upload_type_counts = count($distinct_filetypes);
|
|
if ($upload_type_counts != count($ft_ids)) {
|
|
if ($upload_type_counts != count($ft_ids)) {
|
|
@@ -389,7 +415,7 @@ class Talent extends EnterpriseController {
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
|
|
|
|
- return $this->save($info, $this->request, TalentState::SCND_SUBMIT);
|
|
|
|
|
|
+ return $this->mixSave($info, $this->request, TalentState::SCND_SUBMIT);
|
|
} else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL, TalentState::ZX_FAIL, TalentState::ANNOUNCED_REVERIFY_FAIL, TalentState::PUBLISH_FAIL])) {
|
|
} else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL, TalentState::ZX_FAIL, TalentState::ANNOUNCED_REVERIFY_FAIL, TalentState::PUBLISH_FAIL])) {
|
|
$res = ["msg" => "审核失败,不能再提交审核"];
|
|
$res = ["msg" => "审核失败,不能再提交审核"];
|
|
echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
|
|
echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
|
|
@@ -739,8 +765,18 @@ class Talent extends EnterpriseController {
|
|
Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
|
|
Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
|
|
}
|
|
}
|
|
} else if ($checkState == TalentState::SCND_SUBMIT) {
|
|
} else if ($checkState == TalentState::SCND_SUBMIT) {
|
|
- $data["new_submit_time"] = date("Y-m-d H:i:s");
|
|
|
|
- TalentModel::update($data);
|
|
|
|
|
|
+ if ($data["id"]) {
|
|
|
|
+ $data["new_submit_time"] = date("Y-m-d H:i:s");
|
|
|
|
+ TalentModel::update($data);
|
|
|
|
+ } else {
|
|
|
|
+ //新增
|
|
|
|
+ $data["enterprise_id"] = $this->user["uid"];
|
|
|
|
+ $id = TalentModel::insertGetId($data);
|
|
|
|
+ $whr = [];
|
|
|
|
+ $whr[] = ["fileId", "in", $files];
|
|
|
|
+ $upd_checklog["mainId"] = $id;
|
|
|
|
+ Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
|
|
|
|
+ }
|
|
TalentLogApi::write(1, $data["id"], $checkState, "确认提交审核", 1);
|
|
TalentLogApi::write(1, $data["id"], $checkState, "确认提交审核", 1);
|
|
} else {
|
|
} else {
|
|
throw new ValidateException($error_msg);
|
|
throw new ValidateException($error_msg);
|