param("order")) ?: "desc"; $offset = trim($request->param("offset")) ?: 0; $limit = trim($request->param("limit")) ?: 10; $name = trim($request->param("name")); $idCard = trim($request->param("card_number")); $sex = trim($request->param("sex")); $nation = trim($request->param("nation")); $nationality = trim($request->param("nationality")); $talentArrange = trim($request->param("talent_arrange")); $checkState = trim($request->param("checkState")); $type = session("user")["type"]; $where = []; $where[] = ["delete", "=", 0]; if (session("user")["usertype"] == 2) { $where[] = ["enterprise_id", "=", session("user")["uid"]]; } if ($step) { switch ($step) { case 1: $where[] = ["checkState", "in", [TalentState::FST_SAVE, TalentState::BASE_REJECT, TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_FAIL]]; switch ($checkState) { case -1: $where[] = ["checkState", "=", TalentState::BASE_VERIFY_FAIL]; break; case 1: $where[] = ["checkState", "=", TalentState::FST_SAVE]; break; case 2: $where[] = ["checkState", "=", TalentState::BASE_REJECT]; break; case 3: $where[] = ["checkState", "=", TalentState::FST_SUBMIT]; break; } break; case 2: $where[] = ["checkState", "not in", [TalentState::FST_SAVE, TalentState::BASE_REJECT, TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_FAIL]]; switch ($checkState) { case -1: $where[] = ["checkState", "in", [TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL, TalentState::ZX_FAIL, TalentState::ANNOUNCED_REVERIFY_FAIL, TalentState::PUBLISH_FAIL]]; break; case 1: $where[] = ["checkState", "=", TalentState::SCND_SAVE]; break; case 2: $where[] = ["checkState", "in", [TalentState::FST_VERIFY_REJECT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT]]; break; case 3: $where[] = ["checkState", "in", [TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::REVERIFY_PASS, TalentState::ZX_PASS, TalentState::ANNOUNCED_REVERIFY_PASS, TalentState::PUBLISH_PASS]]; break; case 4: $where[] = ["checkState", "=", TalentState::CERTIFICATED]; break; } } if ($name) { $where[] = ["name", "like", "%" . $name . "%"]; } if ($idCard) { $where[] = ["card_number", "like", "%" . $idCard . "%"]; } if ($sex) { $where[] = ["sex", "=", $sex]; } if ($nation) { $where[] = ["nation", "=", $nation]; } if ($nationality) { $where[] = ["nationality", "=", $nationality]; } if ($talentArrange) { $where[] = ["talent_arrange", "=", $talentArrange]; } $count = Talent::where($where)->count(); $list = Talent::where($where)->limit($offset, $limit)->order("createTime " . $order)->select()->toArray(); $talentTagList = DictApi::selectByParentCode("enterprise_tag"); //单位标签 $talentArangeList = DictApi::selectByParentCode("talent_arrange"); //人才层次 $industries = DictApi::selectByParentCode("industry_field"); //产业 $enterprise = \app\common\model\Enterprise::find(session("user")["uid"]); foreach ($list as $key => $item) { $condition = TalentConditionApi::getOne($item["talent_condition"]); $list[$key]["talentArrangeName"] = isset($talentArangeList[$item["talent_arrange"]]) ? $talentArangeList[$item["talent_arrange"]] : ""; $list[$key]["identifyConditionText"] = $condition["name"]; $list[$key]["companyIds"] = $condition["companyIds"]; $list[$key]["type"] = $enterprise["type"]; $list[$key]["enterpriseName"] = $enterprise["name"]; $list[$key]["industryName"] = $industries[$enterprise["industryFieldNew"]]; $list[$key]["enterpriseTagName"] = $talentTagList[$enterprise["enterpriseTag"]]; $last_log = TalentLogApi::getLastLog($item["id"], 1); $list[$key]["real_state"] = $last_log["state"]; $list[$key]["last_state"] = $last_log["last_state"]; } return ["total" => $count, "rows" => $list]; } } }