param("order")) ?: "desc"; $offset = trim($request->param("offset")) ?: 0; $limit = trim($request->param("limit")) ?: 10; $name = trim($request->param("name")); $idCard = trim($request->param("idCard")); $sex = trim($request->param("sex")); $nation = trim($request->param("nation")); $nationality = trim($request->param("nationality")); $talentType = trim($request->param("talentType")); $talentArrange = trim($request->param("talentArrange")); $checkState = trim($request->param("checkState")); $where = []; if ($name) { $where[] = ["name", "like", "%" . $name . "%"]; } if ($idCard) { $where[] = ["idCard", "like", "%" . $idCard . "%"]; } if ($sex) { $where[] = ["sex", $sex]; } if ($nation) { $where[] = ["nation", $nation]; } if ($nationality) { $where[] = ["nationality", $nationality]; } if ($talentType) { $where[] = ["talentType", $talentType]; } if ($talentArrange) { $where[] = ["name", $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 = \app\common\api\DictApi::selectByParentCode("un_jbt_talentType");//人才标签 foreach($list as $key=>$list){ $list[$key]["talentArrangeName"]=''; $list[$key]["talentTypeName"]=''; $list[$key]["identifyConditionName"]=''; } return ["total" => $count, "rows" => $list]; } }