count(); $list = TaModel::where($where)->limit($offset, $limit)->order("year " . $order)->select()->toArray(); $levelList = DictApi::selectByParentCode("talent_arrange"); $talentTypeList = DictApi::selectByParentCode("enterprise_tag"); $streetList = DictApi::selectByParentCode("street"); $identifyConditionIds = array_filter(array_unique(array_column($list, "identifyCondition"))); $whr[] = ["id", "in", $identifyConditionIds]; $whr[] = ["type", "=", $user["type"]]; $identifyConditionKvList = TalentConditionApi::getKvList($whr); foreach ($list as $key => $item) { $list[$key]["talentArrangeName"] = $levelList[$item["talentArrange"]]; $list[$key]["talentTypeName"] = $talentTypeList[$item["talentType"]]; $list[$key]["addressName"] = $streetList[$item["address"]]; $list[$key]["identifyConditionText"] = $identifyConditionKvList[$item["identifyCondition"]]; } return ["total" => $count, "rows" => $list]; } public static function setTalentAllowanceInfo($params) { $where = []; if (\StrUtil::isNotEmpAndNull($params["year"])) { $where[] = ["year", "=", $params["year"]]; } if (\StrUtil::isNotEmpAndNull($params["enterpriseName"])) { $where[] = ["enterpriseName", "like", "%" . $params["enterpriseName"] . "%"]; } if (\StrUtil::isNotEmpAndNull($params["name"])) { $where[] = ["name", "like", "%" . $params["name"] . "%"]; } if (\StrUtil::isNotEmpAndNull($params["talentType"])) { $where[] = ["talentType", "=", $params["talentType"]]; } if (\StrUtil::isNotEmpAndNull($params["talentArrange"])) { $where[] = ["talentArrange", "=", $params["talentArrange"]]; } if (\StrUtil::isNotEmpAndNull($params["identiryCondition"])) { $where[] = ["identifyCondition", "=", $params["identifyCondition"]]; } if (\StrUtil::isNotEmpAndNull($params["address"])) { $where[] = ["address", "=", $params["address"]]; } return $where; } public static function getInfoById($id) { return TaModel::findOrEmpty($id)->toArray(); } public static function getApplyCountByIdCard($idCard) { $where = []; $where[] = ["idCard", "=", $idCard]; $where[] = ["checkState", "<>", MainState::NOTPASS]; $list = TaModel::where($where)->distinct(true)->field("substr(year,1,4) as year")->select()->toArray(); $years = array_column($list, "year"); return $years; } public static function getPassYearsByIdCard($idCard) { $where = []; $where[] = ["idCard", "=", $idCard]; $where[] = ["checkState", "=", MainState::PASS]; $list = TaModel::where($where)->distinct(true)->field("substr(year,1,4) as year")->select()->toArray(); $passYears = array_column($list, "year"); return $passYears; } }