|
@@ -309,8 +309,9 @@ class Talent extends AdminController {
|
|
|
}
|
|
|
|
|
|
private function getCommonAssigns() {
|
|
|
+ $type = $this->user["type"];
|
|
|
$enterprises = EnterpriseApi::getSimpleList();
|
|
|
- $conditions = TalentConditionApi::getList([1, 2, 3, 4, 5, 6, 7], $this->user["type"]);
|
|
|
+ $conditions = TalentConditionApi::getList([1, 2, 3, 4, 5, 6, 7], $type);
|
|
|
$industry_field_new = array_column(DictApi::findChildDictByCode("industry_field"), "code");
|
|
|
foreach ($industry_field_new as &$field) {
|
|
|
$field .= "_field";
|
|
@@ -318,7 +319,7 @@ class Talent extends AdminController {
|
|
|
$parent_industry_fields = implode(",", $industry_field_new);
|
|
|
$where[] = ["d2.code", "in", $parent_industry_fields];
|
|
|
$industry_field_old = \app\common\model\Dict::alias("d1")->field("d1.*,d2.`name` as pname")->leftJoin("new_talent_dict d2", "d1.pid=d2.id")->order("name asc")->where($where)->select();
|
|
|
- return ["enterprises" => $enterprises, "talent_conditions" => $conditions, "industry_field_old" => $industry_field_old];
|
|
|
+ return ["type" => $type, "enterprises" => $enterprises, "talent_conditions" => $conditions, "industry_field_old" => $industry_field_old];
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -326,16 +327,7 @@ class Talent extends AdminController {
|
|
|
* @auth {{/talentInfo/gotoIndex/5}}
|
|
|
*/
|
|
|
public function library() {
|
|
|
- $enterprises = EnterpriseApi::getSimpleList();
|
|
|
- $conditions = TalentConditionApi::getList([1, 2, 3, 4, 5, 6, 7], $this->user["type"]);
|
|
|
- $industry_field_new = array_column(DictApi::findChildDictByCode("industry_field"), "code");
|
|
|
- foreach ($industry_field_new as &$field) {
|
|
|
- $field .= "_field";
|
|
|
- }
|
|
|
- $parent_industry_fields = implode(",", $industry_field_new);
|
|
|
- $where[] = ["d2.code", "in", $parent_industry_fields];
|
|
|
- $industry_field_old = \app\common\model\Dict::alias("d1")->field("d1.*,d2.`name` as pname")->leftJoin("new_talent_dict d2", "d1.pid=d2.id")->order("name asc")->where($where)->select();
|
|
|
- return view("", ["enterprises" => $enterprises, "talent_conditions" => $conditions, "industry_field_old" => $industry_field_old]);
|
|
|
+ return view("", $this->getCommonAssigns());
|
|
|
}
|
|
|
|
|
|
public function selectNeedCheckData() {
|
|
@@ -1759,6 +1751,60 @@ class Talent extends AdminController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 人才库-取消人才
|
|
|
+ * @auth {{/talentInfo/libraryCancle}}
|
|
|
+ */
|
|
|
+ public function removeFromLibrary() {
|
|
|
+ $responseObj = new \stdClass();
|
|
|
+ $params = $this->request->param();
|
|
|
+ $info = VerifyApi::getOne($params["id"]);
|
|
|
+ if (!$params["id"] || !$info) {
|
|
|
+ $responseObj->msg = "系统错误,请联系管理员";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ if ($info["active"] != 2) {
|
|
|
+ $responseObj->msg = "该人才未处于离职状态,无法取消";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ if ($info["isEffect"] == 4) {
|
|
|
+ $responseObj->msg = "无法重复取消";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ if (VerifyApi::setEffect($info["id"], 4, ["description" => "取消优秀人才", "stateChange" => "有效->无效", "active" => 1])) {
|
|
|
+ $responseObj->code = 200;
|
|
|
+ $responseObj->msg = "取消优秀人才成功";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ $responseObj->msg = "系统错误,请联系管理员";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 人才库-恢复人才
|
|
|
+ * @auth {{/talentInfo/libraryRecovery}}
|
|
|
+ */
|
|
|
+ public function recovery() {
|
|
|
+ $responseObj = new \stdClass();
|
|
|
+ $params = $this->request->param();
|
|
|
+ $info = VerifyApi::getOne($params["id"]);
|
|
|
+ if (!$params["id"] || !$info) {
|
|
|
+ $responseObj->msg = "系统错误,请联系管理员";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ if ($info["isEffect"] != 4) {
|
|
|
+ $responseObj->msg = "无法恢复有效数据";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ if (VerifyApi::setEffect($info["id"], 1, ["description" => "恢复优秀人才", "stateChange" => "无效->有效", "active" => 1])) {
|
|
|
+ $responseObj->code = 200;
|
|
|
+ $responseObj->msg = "恢复优秀人才成功";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ $responseObj->msg = "系统错误,请联系管理员";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+
|
|
|
public function baseVerifyListExport() {
|
|
|
$this->commonExport(1);
|
|
|
}
|