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")); $where = []; if (session("user")["usertype"] == 2) { $where[] = ["enterprise_id", "=", session("user")["uid"]]; } 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]; } if ($checkState) { switch ($checkState) { case -1: $where[] = [["checkState", $checkState], ["isPublic", ">=", 5]]; break; case 1: $where[] = [["checkState", $checkState]]; break; case 2: $where[] = [["checkState", "in", "5,10"]]; break; case 3: $where[] = [["checkState", "not in", "1,5,10"], ["isPublic", "<", 5]]; break; case 4: $where[] = [["checkState", 35], ["isPublic", ">=", 5]]; break; } } if ($request->param("type") == 2) { $where[] = [["checkState", 35], ["isPublic", 6]]; } $count = Talent::where($where)->count(); $list = Talent::where($where)->limit($offset, $limit)->order("createTime " . $order)->select()->toArray(); $talentTypeList = DictApi::selectByParentCode("enterprise_tag"); //人才标签 $talentArangeList = DictApi::selectByParentCode("talent_arrange"); //人才层次 //$talentTypeNameList = DictApi::selectByParentCode("un_talentLevel");//认定条件 //DictApi::selectByParentCode($code); foreach ($list as $key => $item) { $list[$key]["talentArrangeName"] = isset($talentArangeList[$item["talent_arrange"]]) ? $talentArangeList[$item["talent_arrange"]] : ""; $list[$key]["identifyConditionText"] = ""; } return ["total" => $count, "rows" => $list]; } }