|
@@ -413,9 +413,7 @@ class VerifyApi {
|
|
|
|
|
|
$process = $params["process"];
|
|
|
if ($process == 4) {
|
|
|
- $companyId = session('user')['companyId'];
|
|
|
- $company_info = CompanyApi::getOne($companyId);
|
|
|
- if ($company_info["code"] == "super" || $company_info["code"] == "rsj") {
|
|
|
+ if (self::chkUserInSuperDeptUsers()) {
|
|
|
return self::getFullDeptList($params, $where);
|
|
|
} else {
|
|
|
return self::getDeptList($params, $where);
|
|
@@ -745,7 +743,7 @@ class VerifyApi {
|
|
|
case 4:
|
|
|
$companyId = session('user')['companyId'];
|
|
|
$company_info = CompanyApi::getOne($companyId);
|
|
|
- if ($company_info["code"] == "super" || $company_info["code"] == "rsj") {
|
|
|
+ if (self::chkUserInSuperDeptUsers()) {
|
|
|
switch ($params["checkState"]) {
|
|
|
case 1:
|
|
|
$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
@@ -837,7 +835,7 @@ class VerifyApi {
|
|
|
$fields[] = "tc.companyIds";
|
|
|
if ($process == 4) {
|
|
|
$fields[] = "tl2.resubmit";
|
|
|
- if ($company_info["code"] == "super" || $company_info["code"] == "rsj") {
|
|
|
+ if (self::chkUserInSuperDeptUsers()) {
|
|
|
$fields[] = "tl3.deptVerifyJsonData";
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
@@ -997,7 +995,7 @@ class VerifyApi {
|
|
|
$item["checkState"] = TalentState::getStateName($item["state"]);
|
|
|
}
|
|
|
if ($process == 4) {
|
|
|
- if (in_array($company_info["code"], ["super", "rsj"])) {
|
|
|
+ if (self::chkUserInSuperDeptUsers()) {
|
|
|
$companys = array_filter(explode(",", $item["companyIds"]));
|
|
|
$deptChecklogs = json_decode($item["deptVerifyJsonData"], true);
|
|
|
$deptChecklogs = bubbleSort($deptChecklogs, "createTime", "desc");
|
|
@@ -1093,4 +1091,17 @@ class VerifyApi {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ private static function getSuperPrivsForDeptVerify() {
|
|
|
+ $config = getJsonConfig("../sys_config.json", "super_privs_for_dept_verify");
|
|
|
+ return $config;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function chkUserInSuperDeptUsers() {
|
|
|
+ $config = self::getSuperPrivsForDeptVerify();
|
|
|
+ $companyId = session("user")["companyId"];
|
|
|
+ $company = getCacheById("Company", $companyId);
|
|
|
+ $account = session("user")["account"];
|
|
|
+ return in_array($company["code"], $config["companys"]) || in_array($account, $config["users"]);
|
|
|
+ }
|
|
|
+
|
|
|
}
|