|
@@ -61,6 +61,19 @@ class Talent extends EnterpriseController {
|
|
|
$no_empty = ["talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "bank", "bank_number", "bank_branch_name",
|
|
|
"bank_account", "study_abroad", "phone", "email", "import_way", "cur_entry_time", "cur_entry_time", "position", "source"];
|
|
|
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["rel", "=", "study_abroad"];
|
|
|
+ $where[] = ["step", "=", 2];
|
|
|
+ $where[] = ["project", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
+ $where[] = ["type", "=", $this->user["type"]];
|
|
|
+ $where[] = ["isConditionFile", "<>", 1];
|
|
|
+ $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
|
|
|
+ $abroad_file_ids = null;
|
|
|
+ if ($abroad_files)
|
|
|
+ $abroad_file_ids = array_column($abroad_files, "id");
|
|
|
+
|
|
|
if ($data["study_abroad"] == 1) {
|
|
|
$no_empty[] = "abroad_school";
|
|
|
$no_empty[] = "abroad_major";
|
|
@@ -81,6 +94,12 @@ class Talent extends EnterpriseController {
|
|
|
$no_empty[] = "source_county";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
|
|
|
+
|
|
|
+ if ($condition_info["isSalary"] == 1) {
|
|
|
+ $no_empty[] = "annual_salary";
|
|
|
+ }
|
|
|
$no_empty = array_filter($no_empty);
|
|
|
$return = [];
|
|
|
foreach ($no_empty as $key) {
|
|
@@ -115,8 +134,6 @@ class Talent extends EnterpriseController {
|
|
|
exit;
|
|
|
}
|
|
|
|
|
|
- $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
|
|
|
-
|
|
|
if ($condition_info["bindFileTypes"]) {
|
|
|
$whr[] = ["id", "in", $condition_info["bindFileTypes"]];
|
|
|
$whr[] = ["must", "=", 1];
|
|
@@ -126,6 +143,8 @@ class Talent extends EnterpriseController {
|
|
|
$where[] = ["project", "=", 1];
|
|
|
$where[] = ["type", "=", $this->user["type"]];
|
|
|
$where[] = ["must", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
$where[] = ["isConditionFile", "<>", 1];
|
|
|
if ($whr) {
|
|
|
$filetypes = Db::table("new_common_filetype")->where([$where, $whr])->select()->toArray();
|
|
@@ -133,6 +152,13 @@ class Talent extends EnterpriseController {
|
|
|
$filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
|
|
|
}
|
|
|
$ft_ids = array_column($filetypes, "id");
|
|
|
+ if ($data["study_abroad"] == 1) {
|
|
|
+ //选中留学,如果存在留学附件变成必传
|
|
|
+ $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
|
|
|
+ } else {
|
|
|
+ //没选中,留学附件就算设成必传也不用验证
|
|
|
+ $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
|
|
|
+ }
|
|
|
$whr = [];
|
|
|
$whr[] = ["typeId", "in", $ft_ids];
|
|
|
$whr[] = ["mainId", "=", $id];
|
|
@@ -140,7 +166,6 @@ class Talent extends EnterpriseController {
|
|
|
$upload_type_counts = count($distinct_filetypes);
|
|
|
|
|
|
if ($upload_type_counts != count($ft_ids)) {
|
|
|
- $test = count($ft_ids);
|
|
|
$res = ["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"];
|
|
|
echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
|
|
|
exit;
|
|
@@ -193,11 +218,27 @@ class Talent extends EnterpriseController {
|
|
|
$whr[] = ["id", "in", $condition_info["bindFileTypes"]];
|
|
|
$whr[] = ["must", "=", 1];
|
|
|
}
|
|
|
+
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["rel", "=", "study_abroad"];
|
|
|
+ $where[] = ["step", "=", 2];
|
|
|
+ $where[] = ["project", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
+ $where[] = ["type", "=", $this->user["type"]];
|
|
|
+ $where[] = ["isConditionFile", "<>", 1];
|
|
|
+ $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
|
|
|
+ $abroad_file_ids = null;
|
|
|
+ if ($abroad_files)
|
|
|
+ $abroad_file_ids = array_column($abroad_files, "id");
|
|
|
+
|
|
|
$where = [];
|
|
|
$where[] = ["step", "=", 2];
|
|
|
$where[] = ["project", "=", 1];
|
|
|
$where[] = ["type", "=", $this->user["type"]];
|
|
|
$where[] = ["must", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
$where[] = ["isConditionFile", "<>", 1];
|
|
|
if ($whr) {
|
|
|
$filetypes = Db::table("new_common_filetype")->where([$where, $whr])->select()->toArray();
|
|
@@ -205,6 +246,13 @@ class Talent extends EnterpriseController {
|
|
|
$filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
|
|
|
}
|
|
|
$ft_ids = array_column($filetypes, "id");
|
|
|
+ if ($info["study_abroad"] == 1) {
|
|
|
+ //选中留学,如果存在留学附件变成必传
|
|
|
+ $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
|
|
|
+ } else {
|
|
|
+ //没选中,留学附件就算设成必传也不用验证
|
|
|
+ $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
|
|
|
+ }
|
|
|
$whr = [];
|
|
|
$whr[] = ["typeId", "in", $ft_ids];
|
|
|
$whr[] = ["mainId", "=", $id];
|