$code, 'msg' => $msg, 'data' => $data]; $response = \think\Response::create($res, 'json'); throw new \think\exception\HttpResponseException($response); } function addPByN($str) { $comdetails = ''; $comdetails_arr = explode("\n", $str); foreach ($comdetails_arr as $v) { $comdetails .= "
{$v}
"; } return $comdetails; } function getWorkExperience($type = 'json') { $json = '[ {id: 1, text: "无经验"}, {id: 2, text: "一年以下"}, {id: 3, text: "1-3年"}, {id: 4, text: "3-5年"}, {id: 5, text: "5-10年"}, {id: 6, text: "10年以上"} ]'; return $type == 'json' ? $json : json_decode($json, true); } function getEducation($type = 'json') { $json = '[ {id: 1, text: "初中"}, {id: 2, text: "高中"}, {id: 3, text: "中技"}, {id: 4, text: "中专"}, {id: 5, text: "大专"}, {id: 6, text: "本科"}, {id: 7, text: "硕士"}, {id: 8, text: "博士"}, ]'; return $type == 'json' ? $json : json_decode($json, true); }