|
@@ -953,9 +953,26 @@ class Talent extends AdminController {
|
|
|
return json(["msg" => "只有曾经达到过部门并审,初审时才可以选择再次审核的部门"]);
|
|
|
if (!$params["companys"])
|
|
|
return json(["msg" => "请选择需要再次审核的部门"]);
|
|
|
+
|
|
|
+
|
|
|
+ $pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"]); //已经通过的单位
|
|
|
+
|
|
|
$condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
$companyIds = array_filter(explode(",", $condition["companyIds"])); //该条件下需要审核的所有单位
|
|
|
- $re_check_companys = array_filter(explode(",", $talent_info["re_check_companys"]));
|
|
|
+ $re_check_companys = array_filter(explode(",", $params["companys"]));
|
|
|
+ $unpass_companyIds = array_diff($companyIds, $pass_companyIds);
|
|
|
+ $unselect_companyIds = [];
|
|
|
+ foreach ($unpass_companyIds as $unpass_companyId) {
|
|
|
+ if (!in_array($unpass_companyId, $re_check_companys))
|
|
|
+ $unselect_companyIds[] = $unpass_companyId;
|
|
|
+ }
|
|
|
+ if ($unselect_companyIds) {
|
|
|
+ $unselect_companyName = [];
|
|
|
+ foreach ($unselect_companyIds as $unselect_companyId) {
|
|
|
+ $unselect_companyName[] = getCacheById("Company", $unselect_companyId)["name"];
|
|
|
+ }
|
|
|
+ return json(["msg" => "以下部门未通过,需要勾选重新审核:<br>" . implode("<br>", $unselect_companyName)]);
|
|
|
+ }
|
|
|
foreach ($re_check_companys as $reCompanyId) {
|
|
|
if (!in_array($reCompanyId, $companyIds)) {
|
|
|
return json(["msg" => "错误的部门"]);
|
|
@@ -1512,8 +1529,8 @@ class Talent extends AdminController {
|
|
|
$returnObj->msg = "请选择需要撤销的对象";
|
|
|
return json($returnObj);
|
|
|
}
|
|
|
- if ($old["checkState"] != TalentState::REVERIFY_PASS) {
|
|
|
- $returnObj->msg = "当前对象不是复核通过状态,无法撤销";
|
|
|
+ if ($old["checkState"] != TalentState::REVERIFY_PASS || $old["checkState"] != TalentState::REVERIFY_FAIL) {
|
|
|
+ $returnObj->msg = "当前对象不是\"复核通过\"或者\"复核不通过\"状态,无法撤销";
|
|
|
return json($returnObj);
|
|
|
}
|
|
|
$where = [];
|