public function getExport(Request $request)
    {
        $year = date("Y") . "0000";
        $spring_from = 100;
        $spring_to = 700;
        if ($request->has('table') && $request->get('table') && $request->get('table') != 'students') {
            $table_name = $request->get('table');
            $table = Generatedtable::where('table_name', '=', $table_name)->first();
            if (!$table) {
                return;
            }
            $name = $table->name;
        } else {
            $table_name = 'students';
            $name = '当前数据';
        }
        $data = array();
        $data['all'] = array();
        $data['all']['sequence'] = '01';
        //毕业结业
        $data['all']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ?', [$year])[0]->count;
        $data['all']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ?', ['毕业结业', ''])[0]->count;
        $data['all']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ?', [$year])[0]->count;
        $data['all']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ?', [$year + $spring_from, $year + $spring_to])[0]->count;
        $data['all']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where stu_type = ? OR stu_type = ?', ['在校生', '新生'])[0]->count;
        $data['all']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ?', ['在校生', '新生', $year])[0]->count;
        $data['all']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ?', ['在校生', '新生', $year - 10000, $year])[0]->count;
        $data['all']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ?', ['在校生', '新生', $year - 20000, $year - 10000])[0]->count;
        $data['all']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ?', ['在校生', '新生', $year - 30000, $year - 20000])[0]->count;
        $data['all']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ?', ['在校生', '新生', $year - 30000])[0]->count;
        $data['girl'] = array();
        $data['girl']['sequence'] = '02';
        $data['girl']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND gender = ?', [$year, '女'])[0]->count;
        $data['girl']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND gender = ?', [$year, '', '女'])[0]->count;
        $data['girl']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND gender = ?', [$year, '女'])[0]->count;
        $data['girl']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND gender = ?', [$year + $spring_from, $year + $spring_to, '女'])[0]->count;
        $data['girl']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND gender = ?', ['在校生', '新生', '女'])[0]->count;
        $data['girl']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND gender = ?', ['在校生', '新生', $year, '女'])[0]->count;
        $data['girl']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND gender = ?', ['在校生', '新生', $year - 10000, $year, '女'])[0]->count;
        $data['girl']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND gender = ?', ['在校生', '新生', $year - 20000, $year - 10000, '女'])[0]->count;
        $data['girl']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND gender = ?', ['在校生', '新生', $year - 30000, $year - 20000, '女'])[0]->count;
        $data['girl']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND gender = ?', ['在校生', '新生', $year - 30000, '女'])[0]->count;
        $data['subtotal'] = array();
        $data['subtotal']['sequence'] = '03';
        $data['subtotal']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND (type = ? OR type = ? OR type = ?)', [$year, '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND (type = ? OR type = ? OR type = ?)', [$year, '', '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND (type = ? OR type = ? OR type = ?)', [$year, '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND (type = ? OR type = ? OR type = ?)', [$year + $spring_from, $year + $spring_to, '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND (type = ? OR type = ? OR type = ?)', ['在校生', '新生', '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND (type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year, '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 10000, $year, '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 20000, $year - 10000, '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 30000, $year - 20000, '本科', '硕研', '博研'])[0]->count;
        $data['subtotal']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND (type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 30000, '本科', '硕研', '博研'])[0]->count;
        $data['junior'] = array();
        $data['junior']['sequence'] = '04';
        $data['junior']['graduate'] = 0;
        $data['junior']['degree'] = 0;
        $data['junior']['admission'] = 0;
        $data['junior']['admission_spring'] = 0;
        $data['junior']['inschool'] = 0;
        $data['junior']['inschool_1'] = 0;
        $data['junior']['inschool_2'] = 0;
        $data['junior']['inschool_3'] = 0;
        $data['junior']['inschool_4'] = 0;
        $data['junior']['inschool_5'] = 0;
        $data['bachelor'] = array();
        $data['bachelor']['sequence'] = '05';
        $data['bachelor']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND type = ?', [$year, '本科'])[0]->count;
        $data['bachelor']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND type = ?', [$year, '', '本科'])[0]->count;
        $data['bachelor']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND type = ?', [$year, '本科'])[0]->count;
        $data['bachelor']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND type = ?', [$year + $spring_from, $year + $spring_to, '本科'])[0]->count;
        $data['bachelor']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND type = ?', ['在校生', '新生', '本科'])[0]->count;
        $data['bachelor']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND type = ?', ['在校生', '新生', $year, '本科'])[0]->count;
        $data['bachelor']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 10000, $year, '本科'])[0]->count;
        $data['bachelor']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 20000, $year - 10000, '本科'])[0]->count;
        $data['bachelor']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 30000, $year - 20000, '本科'])[0]->count;
        $data['bachelor']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND type = ?', ['在校生', '新生', $year - 30000, '本科'])[0]->count;
        $data['master'] = array();
        $data['master']['sequence'] = '06';
        $data['master']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND type = ?', [$year, '硕研'])[0]->count;
        $data['master']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND type = ?', [$year, '', '硕研'])[0]->count;
        $data['master']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND type = ?', [$year, '硕研'])[0]->count;
        $data['master']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND type = ?', [$year + $spring_from, $year + $spring_to, '硕研'])[0]->count;
        $data['master']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND type = ?', ['在校生', '新生', '硕研'])[0]->count;
        $data['master']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND type = ?', ['在校生', '新生', $year, '硕研'])[0]->count;
        $data['master']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 10000, $year, '硕研'])[0]->count;
        $data['master']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 20000, $year - 10000, '硕研'])[0]->count;
        $data['master']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 30000, $year - 20000, '硕研'])[0]->count;
        $data['master']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND type = ?', ['在校生', '新生', $year - 30000, '硕研'])[0]->count;
        $data['doctor'] = array();
        $data['doctor']['sequence'] = '07';
        $data['doctor']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND type = ?', [$year, '博研'])[0]->count;
        $data['doctor']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND type = ?', [$year, '', '博研'])[0]->count;
        $data['doctor']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND type = ?', [$year, '博研'])[0]->count;
        $data['doctor']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND type = ?', [$year + $spring_from, $year + $spring_to, '博研'])[0]->count;
        $data['doctor']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND type = ?', ['在校生', '新生', '博研'])[0]->count;
        $data['doctor']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND type = ?', ['在校生', '新生', $year, '博研'])[0]->count;
        $data['doctor']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 10000, $year, '博研'])[0]->count;
        $data['doctor']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 20000, $year - 10000, '博研'])[0]->count;
        $data['doctor']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND type = ?', ['在校生', '新生', $year - 30000, $year - 20000, '博研'])[0]->count;
        $data['doctor']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND type = ?', ['在校生', '新生', $year - 30000, '博研'])[0]->count;
        $data['trainee'] = array();
        $data['trainee']['sequence'] = '08';
        $data['trainee']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND (type = ? OR type = ? OR type = ? OR type = ?)', [$year, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND (type = ? OR type = ? OR type = ? OR type = ?)', [$year, '', '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND (type = ? OR type = ? OR type = ? OR type = ?)', [$year, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND (type = ? OR type = ? OR type = ? OR type = ?)', [$year + $spring_from, $year + $spring_to, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND (type = ? OR type = ? OR type = ? OR type = ?)', ['在校生', '新生', '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND (type = ? OR type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (type = ? OR type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 10000, $year, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (type = ? OR type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 20000, $year - 10000, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (type = ? OR type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 30000, $year - 20000, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['trainee']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND (type = ? OR type = ? OR type = ? OR type = ?)', ['在校生', '新生', $year - 30000, '高进', '普进', '汉语', '汉补'])[0]->count;
        $data['asia'] = array();
        $data['asia']['sequence'] = '09';
        $data['asia']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND countries.belongs = ?', [$year, '亚洲'])[0]->count;
        $data['asia']['degree'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND ' . $table_name . '.degree_certificate <> ? AND countries.belongs = ?', [$year, '', '亚洲'])[0]->count;
        $data['asia']['admission'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date > ? AND countries.belongs = ?', [$year, '亚洲'])[0]->count;
        $data['asia']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date between ? AND ? AND countries.belongs = ?', [$year + $spring_from, $year + $spring_to, '亚洲'])[0]->count;
        $data['asia']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND countries.belongs = ?', ['在校生', '新生', '亚洲'])[0]->count;
        $data['asia']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 > ? AND countries.belongs = ?', ['在校生', '新生', $year, '亚洲'])[0]->count;
        $data['asia']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 10000, $year, '亚洲'])[0]->count;
        $data['asia']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 20000, $year - 10000, '亚洲'])[0]->count;
        $data['asia']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, $year - 20000, '亚洲'])[0]->count;
        $data['asia']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 < ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, '亚洲'])[0]->count;
        $data['africa'] = array();
        $data['africa']['sequence'] = '10';
        $data['africa']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND countries.belongs = ?', [$year, '非洲'])[0]->count;
        $data['africa']['degree'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND ' . $table_name . '.degree_certificate <> ? AND countries.belongs = ?', [$year, '', '非洲'])[0]->count;
        $data['africa']['admission'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date > ? AND countries.belongs = ?', [$year, '非洲'])[0]->count;
        $data['africa']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date between ? AND ? AND countries.belongs = ?', [$year + $spring_from, $year + $spring_to, '非洲'])[0]->count;
        $data['africa']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND countries.belongs = ?', ['在校生', '新生', '非洲'])[0]->count;
        $data['africa']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 > ? AND countries.belongs = ?', ['在校生', '新生', $year, '非洲'])[0]->count;
        $data['africa']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 10000, $year, '非洲'])[0]->count;
        $data['africa']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 20000, $year - 10000, '非洲'])[0]->count;
        $data['africa']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, $year - 20000, '非洲'])[0]->count;
        $data['africa']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 < ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, '非洲'])[0]->count;
        $data['europe'] = array();
        $data['europe']['sequence'] = '11';
        $data['europe']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND countries.belongs = ?', [$year, '欧洲'])[0]->count;
        $data['europe']['degree'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND ' . $table_name . '.degree_certificate <> ? AND countries.belongs = ?', [$year, '', '欧洲'])[0]->count;
        $data['europe']['admission'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date > ? AND countries.belongs = ?', [$year, '欧洲'])[0]->count;
        $data['europe']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date between ? AND ? AND countries.belongs = ?', [$year + $spring_from, $year + $spring_to, '欧洲'])[0]->count;
        $data['europe']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND countries.belongs = ?', ['在校生', '新生', '欧洲'])[0]->count;
        $data['europe']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 > ? AND countries.belongs = ?', ['在校生', '新生', $year, '欧洲'])[0]->count;
        $data['europe']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 10000, $year, '欧洲'])[0]->count;
        $data['europe']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 20000, $year - 10000, '欧洲'])[0]->count;
        $data['europe']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, $year - 20000, '欧洲'])[0]->count;
        $data['europe']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 < ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, '欧洲'])[0]->count;
        $data['north_america'] = array();
        $data['north_america']['sequence'] = '12';
        $data['north_america']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND countries.belongs = ?', [$year, '北美洲'])[0]->count;
        $data['north_america']['degree'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND ' . $table_name . '.degree_certificate <> ? AND countries.belongs = ?', [$year, '', '北美洲'])[0]->count;
        $data['north_america']['admission'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date > ? AND countries.belongs = ?', [$year, '北美洲'])[0]->count;
        $data['north_america']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date between ? AND ? AND countries.belongs = ?', [$year + $spring_from, $year + $spring_to, '北美洲'])[0]->count;
        $data['north_america']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND countries.belongs = ?', ['在校生', '新生', '北美洲'])[0]->count;
        $data['north_america']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 > ? AND countries.belongs = ?', ['在校生', '新生', $year, '北美洲'])[0]->count;
        $data['north_america']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 10000, $year, '北美洲'])[0]->count;
        $data['north_america']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 20000, $year - 10000, '北美洲'])[0]->count;
        $data['north_america']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, $year - 20000, '北美洲'])[0]->count;
        $data['north_america']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 < ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, '北美洲'])[0]->count;
        $data['south_america'] = array();
        $data['south_america']['sequence'] = '13';
        $data['south_america']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND countries.belongs = ?', [$year, '南美洲'])[0]->count;
        $data['south_america']['degree'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND ' . $table_name . '.degree_certificate <> ? AND countries.belongs = ?', [$year, '', '南美洲'])[0]->count;
        $data['south_america']['admission'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date > ? AND countries.belongs = ?', [$year, '南美洲'])[0]->count;
        $data['south_america']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date between ? AND ? AND countries.belongs = ?', [$year + $spring_from, $year + $spring_to, '南美洲'])[0]->count;
        $data['south_america']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND countries.belongs = ?', ['在校生', '新生', '南美洲'])[0]->count;
        $data['south_america']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 > ? AND
countries.belongs = ?', ['在校生', '新生', $year, '南美洲'])[0]->count;
        $data['south_america']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 10000, $year, '南美洲'])[0]->count;
        $data['south_america']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 20000, $year - 10000, '南美洲'])[0]->count;
        $data['south_america']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, $year - 20000, '南美洲'])[0]->count;
        $data['south_america']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 < ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, '南美洲'])[0]->count;
        $data['oceania'] = array();
        $data['oceania']['sequence'] = '14';
        $data['oceania']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND countries.belongs = ?', [$year, '大洋洲'])[0]->count;
        $data['oceania']['degree'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.graduate_date > ? AND ' . $table_name . '.degree_certificate <> ? AND countries.belongs = ?', [$year, '', '大洋洲'])[0]->count;
        $data['oceania']['admission'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date > ? AND countries.belongs = ?', [$year, '大洋洲'])[0]->count;
        $data['oceania']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND ' . $table_name . '.admission_date between ? AND ? AND countries.belongs = ?', [$year + $spring_from, $year + $spring_to, '大洋洲'])[0]->count;
        $data['oceania']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND countries.belongs = ?', ['在校生', '新生', '大洋洲'])[0]->count;
        $data['oceania']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 > ? AND countries.belongs = ?', ['在校生', '新生', $year, '大洋洲'])[0]->count;
        $data['oceania']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 10000, $year, '大洋洲'])[0]->count;
        $data['oceania']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 20000, $year - 10000, '大洋洲'])[0]->count;
        $data['oceania']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, $year - 20000, '大洋洲'])[0]->count;
        $data['oceania']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ', countries where ' . $table_name . '.nationality = countries.country AND (' . $table_name . '.stu_type = ? OR ' . $table_name . '.stu_type = ?) AND admission_date + suspend_years*10000 < ? AND countries.belongs = ?', ['在校生', '新生', $year - 30000, '大洋洲'])[0]->count;
        $data['international_organization'] = array();
        $data['international_organization']['sequence'] = '15';
        $data['international_organization']['graduate'] = 0;
        $data['international_organization']['degree'] = 0;
        $data['international_organization']['admission'] = 0;
        $data['international_organization']['admission_spring'] = 0;
        $data['international_organization']['inschool'] = 0;
        $data['international_organization']['inschool_1'] = 0;
        $data['international_organization']['inschool_2'] = 0;
        $data['international_organization']['inschool_3'] = 0;
        $data['international_organization']['inschool_4'] = 0;
        $data['international_organization']['inschool_5'] = 0;
        $data['chinese_government'] = array();
        $data['chinese_government']['sequence'] = '16';
        $data['chinese_government']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND (fee_type = ? OR fee_type = ?)', [$year, '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND (fee_type = ? OR fee_type = ?)', [$year, '', '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND (fee_type = ? OR fee_type = ?)', [$year, '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND (fee_type = ? OR fee_type = ?)', [$year + $spring_from, $year + $spring_to, '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year, '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 10000, $year, '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 20000, $year - 10000, '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 30000, $year - 20000, '免学费', '全额奖学金'])[0]->count;
        $data['chinese_government']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 30000, '免学费', '全额奖学金'])[0]->count;
        $data['home_government'] = array();
        $data['home_government']['sequence'] = '17';
        $data['home_government']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND  fee_type like ?', [$year, '%本国%'])[0]->count;
        $data['home_government']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND fee_type like ?', [$year, '', '%本国%'])[0]->count;
        $data['home_government']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND fee_type like ?', [$year, '%本国%'])[0]->count;
        $data['home_government']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND fee_type like ?', [$year + $spring_from, $year + $spring_to, '%本国%'])[0]->count;
        $data['home_government']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND fee_type like ?', ['在校生', '新生', '%本国%'])[0]->count;
        $data['home_government']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND fee_type like ?', ['在校生', '新生', $year, '%本国%'])[0]->count;
        $data['home_government']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND fee_type like ?', ['在校生', '新生', $year - 10000, $year, '%本国%'])[0]->count;
        $data['home_government']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND fee_type like ?', ['在校生', '新生', $year - 20000, $year - 10000, '%本国%'])[0]->count;
        $data['home_government']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND fee_type like ?', ['在校生', '新生', $year - 30000, $year - 20000, '%本国%'])[0]->count;
        $data['home_government']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND fee_type like ?', ['在校生', '新生', $year - 30000, '%本国%'])[0]->count;
        $data['exchange'] = array();
        $data['exchange']['sequence'] = '18';
        $data['exchange']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND  fee_type like ?', [$year, '%交换%'])[0]->count;
        $data['exchange']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND fee_type like ?', [$year, '', '%交换%'])[0]->count;
        $data['exchange']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND fee_type like ?', [$year, '%交换%'])[0]->count;
        $data['exchange']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND fee_type like ?', [$year + $spring_from, $year + $spring_to, '%交换%'])[0]->count;
        $data['exchange']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND fee_type like ?', ['在校生', '新生', '%交换%'])[0]->count;
        $data['exchange']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND fee_type like ?', ['在校生', '新生', $year, '%交换%'])[0]->count;
        $data['exchange']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND fee_type like ?', ['在校生', '新生', $year - 10000, $year, '%交换%'])[0]->count;
        $data['exchange']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND fee_type like ?', ['在校生', '新生', $year - 20000, $year - 10000, '%交换%'])[0]->count;
        $data['exchange']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND fee_type like ?', ['在校生', '新生', $year - 30000, $year - 20000, '%交换%'])[0]->count;
        $data['exchange']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND fee_type like ?', ['在校生', '新生', $year - 30000, '%交换%'])[0]->count;
        $data['own'] = array();
        $data['own']['sequence'] = '19';
        $data['own']['graduate'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND (fee_type = ? OR fee_type = ?)', [$year, '自费', '校长奖学金'])[0]->count;
        $data['own']['degree'] = DB::select('select count(*) as count from ' . $table_name . ' where graduate_date > ? AND degree_certificate <> ? AND (fee_type = ? OR fee_type = ?)', [$year, '', '自费', '校长奖学金'])[0]->count;
        $data['own']['admission'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date > ? AND (fee_type = ? OR fee_type = ?)', [$year, '自费', '校长奖学金'])[0]->count;
        $data['own']['admission_spring'] = DB::select('select count(*) as count from ' . $table_name . ' where admission_date between ? AND ? AND (fee_type = ? OR fee_type = ?)', [$year + $spring_from, $year + $spring_to, '自费', '校长奖学金'])[0]->count;
        $data['own']['inschool'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', '自费', '校长奖学金'])[0]->count;
        $data['own']['inschool_1'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 > ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year, '自费', '校长奖学金'])[0]->count;
        $data['own']['inschool_2'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 10000, $year, '自费', '校长奖学金'])[0]->count;
        $data['own']['inschool_3'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 20000, $year - 10000, '自费', '校长奖学金'])[0]->count;
        $data['own']['inschool_4'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 between ? AND ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 30000, $year - 20000, '自费', '校长奖学金'])[0]->count;
        $data['own']['inschool_5'] = DB::select('select count(*) as count from ' . $table_name . ' where (stu_type = ? OR stu_type = ?) AND admission_date + suspend_years*10000 < ? AND (fee_type = ? OR fee_type = ?)', ['在校生', '新生', $year - 30000, '自费', '校长奖学金'])[0]->count;
        //var_dump($data);
        //return ;
        $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM;
        PHPExcel_Settings::setCacheStorageMethod($cacheMethod);
        $objPHPExcel = new PHPExcel();
        $objPHPExcel->getDefaultStyle()->getFont()->setName('宋体');
        $objPHPExcel->setActiveSheetIndex(0);
        $objPHPExcel->getActiveSheet()->setTitle('统计信息');
        //第1/2行
        $objPHPExcel->getActiveSheet()->mergeCells('A1:B2');
        $objPHPExcel->getActiveSheet()->setCellValue('A1', '');
        $objPHPExcel->getActiveSheet()->mergeCells('C1:C2');
        $objPHPExcel->getActiveSheet()->setCellValue('C1', '编号');
        $objPHPExcel->getActiveSheet()->mergeCells('D1:D2');
        $objPHPExcel->getActiveSheet()->setCellValue('D1', '毕(结)业生数');
        $objPHPExcel->getActiveSheet()->mergeCells('E1:E2');
        $objPHPExcel->getActiveSheet()->setCellValue('E1', '授予学位数');
        $objPHPExcel->getActiveSheet()->mergeCells('F1:G1');
        $objPHPExcel->getActiveSheet()->setCellValue('F1', '招生数');
        $objPHPExcel->getActiveSheet()->setCellValue('F2', '计');
        $objPHPExcel->getActiveSheet()->setCellValue('G2', '其中:春季招生');
        $objPHPExcel->getActiveSheet()->mergeCells('H1:M1');
        $objPHPExcel->getActiveSheet()->setCellValue('H1', "在校(注册)生数");
        $objPHPExcel->getActiveSheet()->setCellValue('H2', '合计');
        $objPHPExcel->getActiveSheet()->setCellValue('I2', '第一年');
        $objPHPExcel->getActiveSheet()->setCellValue('J2', '第二年');
        $objPHPExcel->getActiveSheet()->setCellValue('K2', '第三年');
        $objPHPExcel->getActiveSheet()->setCellValue('L2', '第四年');
        $objPHPExcel->getActiveSheet()->setCellValue('M2', '第五年及以上');
        //第3行
        $objPHPExcel->getActiveSheet()->mergeCells('A3:B3');
        $objPHPExcel->getActiveSheet()->setCellValue('A3', '甲');
        $objPHPExcel->getActiveSheet()->setCellValue('C3', '乙');
        $objPHPExcel->getActiveSheet()->setCellValue('D3', '1');
        $objPHPExcel->getActiveSheet()->setCellValue('E3', '2');
        $objPHPExcel->getActiveSheet()->setCellValue('F3', '3');
        $objPHPExcel->getActiveSheet()->setCellValue('G3', '4');
        $objPHPExcel->getActiveSheet()->setCellValue('H3', '5');
        $objPHPExcel->getActiveSheet()->setCellValue('I3', '6');
        $objPHPExcel->getActiveSheet()->setCellValue('J3', '7');
        $objPHPExcel->getActiveSheet()->setCellValue('K3', '8');
        $objPHPExcel->getActiveSheet()->setCellValue('L3', '9');
        $objPHPExcel->getActiveSheet()->setCellValue('M3', '10');
        //第4行
        $objPHPExcel->getActiveSheet()->mergeCells('A4:B4');
        $objPHPExcel->getActiveSheet()->setCellValue('A4', '总计');
        $objPHPExcel->getActiveSheet()->setCellValue('C4', $data['all']['sequence'] ? $data['all']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D4', $data['all']['graduate'] ? $data['all']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E4', $data['all']['degree'] ? $data['all']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F4', $data['all']['admission'] ? $data['all']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G4', $data['all']['admission_spring'] ? $data['all']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H4', $data['all']['inschool'] ? $data['all']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I4', $data['all']['inschool_1'] ? $data['all']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J4', $data['all']['inschool_2'] ? $data['all']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K4', $data['all']['inschool_3'] ? $data['all']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L4', $data['all']['inschool_4'] ? $data['all']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M4', $data['all']['inschool_5'] ? $data['all']['inschool_5'] : null);
        //第5行
        $objPHPExcel->getActiveSheet()->mergeCells('A5:B5');
        $objPHPExcel->getActiveSheet()->setCellValue('A5', '其中:女');
        $objPHPExcel->getActiveSheet()->setCellValue('C5', $data['girl']['sequence'] ? $data['girl']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D5', $data['girl']['graduate'] ? $data['girl']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E5', $data['girl']['degree'] ? $data['girl']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F5', $data['girl']['admission'] ? $data['girl']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G5', $data['girl']['admission_spring'] ? $data['girl']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H5', $data['girl']['inschool'] ? $data['girl']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I5', $data['girl']['inschool_1'] ? $data['girl']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J5', $data['girl']['inschool_2'] ? $data['girl']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K5', $data['girl']['inschool_3'] ? $data['girl']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L5', $data['girl']['inschool_4'] ? $data['girl']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M5', $data['girl']['inschool_5'] ? $data['girl']['inschool_5'] : null);
        //第6行
        $objPHPExcel->getActiveSheet()->mergeCells('A6:A10');
        $objPHPExcel->getActiveSheet()->setCellValue('A6', '按学历分');
        $objPHPExcel->getActiveSheet()->setCellValue('B6', '小计');
        $objPHPExcel->getActiveSheet()->setCellValue('C6', $data['subtotal']['sequence'] ? $data['subtotal']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D6', $data['subtotal']['graduate'] ? $data['subtotal']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E6', $data['subtotal']['degree'] ? $data['subtotal']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F6', $data['subtotal']['admission'] ? $data['subtotal']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G6', $data['subtotal']['admission_spring'] ? $data['subtotal']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H6', $data['subtotal']['inschool'] ? $data['subtotal']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I6', $data['subtotal']['inschool_1'] ? $data['subtotal']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J6', $data['subtotal']['inschool_2'] ? $data['subtotal']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K6', $data['subtotal']['inschool_3'] ? $data['subtotal']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L6', $data['subtotal']['inschool_4'] ? $data['subtotal']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M6', $data['subtotal']['inschool_5'] ? $data['subtotal']['inschool_5'] : null);
        //第7行
        $objPHPExcel->getActiveSheet()->setCellValue('B7', '专科');
        $objPHPExcel->getActiveSheet()->setCellValue('C7', $data['junior']['sequence'] ? $data['junior']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D7', $data['junior']['graduate'] ? $data['junior']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E7', $data['junior']['degree'] ? $data['junior']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F7', $data['junior']['admission'] ? $data['junior']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G7', $data['junior']['admission_spring'] ? $data['junior']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H7', $data['junior']['inschool'] ? $data['junior']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I7', $data['junior']['inschool_1'] ? $data['junior']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J7', $data['junior']['inschool_2'] ? $data['junior']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K7', $data['junior']['inschool_3'] ? $data['junior']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L7', $data['junior']['inschool_4'] ? $data['junior']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M7', $data['junior']['inschool_5'] ? $data['junior']['inschool_5'] : null);
        //第8行
        $objPHPExcel->getActiveSheet()->setCellValue('B8', '本科');
        $objPHPExcel->getActiveSheet()->setCellValue('C8', $data['bachelor']['sequence'] ? $data['bachelor']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D8', $data['bachelor']['graduate'] ? $data['bachelor']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E8', $data['bachelor']['degree'] ? $data['bachelor']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F8', $data['bachelor']['admission'] ? $data['bachelor']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G8', $data['bachelor']['admission_spring'] ? $data['bachelor']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H8', $data['bachelor']['inschool'] ? $data['bachelor']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I8', $data['bachelor']['inschool_1'] ? $data['bachelor']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J8', $data['bachelor']['inschool_2'] ? $data['bachelor']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K8', $data['bachelor']['inschool_3'] ? $data['bachelor']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L8', $data['bachelor']['inschool_4'] ? $data['bachelor']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M8', $data['bachelor']['inschool_5'] ? $data['bachelor']['inschool_5'] : null);
        //第9行
        $objPHPExcel->getActiveSheet()->setCellValue('B9', '硕士研究生');
        $objPHPExcel->getActiveSheet()->setCellValue('C9', $data['master']['sequence'] ? $data['master']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D9', $data['master']['graduate'] ? $data['master']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E9', $data['master']['degree'] ? $data['master']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F9', $data['master']['admission'] ? $data['master']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G9', $data['master']['admission_spring'] ? $data['master']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H9', $data['master']['inschool'] ? $data['master']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I9', $data['master']['inschool_1'] ? $data['master']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J9', $data['master']['inschool_2'] ? $data['master']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K9', $data['master']['inschool_3'] ? $data['master']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L9', $data['master']['inschool_4'] ? $data['master']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M9', $data['master']['inschool_5'] ? $data['master']['inschool_5'] : null);
        //第10行
        $objPHPExcel->getActiveSheet()->setCellValue('B10', '博士研究生');
        $objPHPExcel->getActiveSheet()->setCellValue('C10', $data['doctor']['sequence'] ? $data['doctor']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D10', $data['doctor']['graduate'] ? $data['doctor']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E10', $data['doctor']['degree'] ? $data['doctor']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F10', $data['doctor']['admission'] ? $data['doctor']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G10', $data['doctor']['admission_spring'] ? $data['doctor']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H10', $data['doctor']['inschool'] ? $data['doctor']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I10', $data['doctor']['inschool_1'] ? $data['doctor']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J10', $data['doctor']['inschool_2'] ? $data['doctor']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K10', $data['doctor']['inschool_3'] ? $data['doctor']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L10', $data['doctor']['inschool_4'] ? $data['doctor']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M10', $data['doctor']['inschool_5'] ? $data['doctor']['inschool_5'] : null);
        //第11行
        $objPHPExcel->getActiveSheet()->mergeCells('A11:B11');
        $objPHPExcel->getActiveSheet()->setCellValue('A11', '培训');
        $objPHPExcel->getActiveSheet()->setCellValue('C11', $data['trainee']['sequence'] ? $data['trainee']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D11', $data['trainee']['graduate'] ? $data['trainee']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E11', $data['trainee']['degree'] ? $data['trainee']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F11', $data['trainee']['admission'] ? $data['trainee']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G11', $data['trainee']['admission_spring'] ? $data['trainee']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H11', $data['trainee']['inschool'] ? $data['trainee']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I11', $data['trainee']['inschool_1'] ? $data['trainee']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J11', $data['trainee']['inschool_2'] ? $data['trainee']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K11', $data['trainee']['inschool_3'] ? $data['trainee']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L11', $data['trainee']['inschool_4'] ? $data['trainee']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M11', $data['trainee']['inschool_5'] ? $data['trainee']['inschool_5'] : null);
        //第12行
        $objPHPExcel->getActiveSheet()->mergeCells('A12:A17');
        $objPHPExcel->getActiveSheet()->setCellValue('A12', '按大洲分');
        $objPHPExcel->getActiveSheet()->setCellValue('B12', '亚洲');
        $objPHPExcel->getActiveSheet()->setCellValue('C12', $data['asia']['sequence'] ? $data['asia']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D12', $data['asia']['graduate'] ? $data['asia']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E12', $data['asia']['degree'] ? $data['asia']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F12', $data['asia']['admission'] ? $data['asia']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G12', $data['asia']['admission_spring'] ? $data['asia']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H12', $data['asia']['inschool'] ? $data['asia']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I12', $data['asia']['inschool_1'] ? $data['asia']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J12', $data['asia']['inschool_2'] ? $data['asia']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K12', $data['asia']['inschool_3'] ? $data['asia']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L12', $data['asia']['inschool_4'] ? $data['asia']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M12', $data['asia']['inschool_5'] ? $data['asia']['inschool_5'] : null);
        //第13行
        $objPHPExcel->getActiveSheet()->setCellValue('B13', '非洲');
        $objPHPExcel->getActiveSheet()->setCellValue('C13', $data['africa']['sequence'] ? $data['africa']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D13', $data['africa']['graduate'] ? $data['africa']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E13', $data['africa']['degree'] ? $data['africa']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F13', $data['africa']['admission'] ? $data['africa']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G13', $data['africa']['admission_spring'] ? $data['africa']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H13', $data['africa']['inschool'] ? $data['africa']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I13', $data['africa']['inschool_1'] ? $data['africa']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J13', $data['africa']['inschool_2'] ? $data['africa']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K13', $data['africa']['inschool_3'] ? $data['africa']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L13', $data['africa']['inschool_4'] ? $data['africa']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M13', $data['africa']['inschool_5'] ? $data['africa']['inschool_5'] : null);
        //第14行
        $objPHPExcel->getActiveSheet()->setCellValue('B14', '欧洲');
        $objPHPExcel->getActiveSheet()->setCellValue('C14', $data['europe']['sequence'] ? $data['europe']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D14', $data['europe']['graduate'] ? $data['europe']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E14', $data['europe']['degree'] ? $data['europe']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F14', $data['europe']['admission'] ? $data['europe']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G14', $data['europe']['admission_spring'] ? $data['europe']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H14', $data['europe']['inschool'] ? $data['europe']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I14', $data['europe']['inschool_1'] ? $data['europe']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J14', $data['europe']['inschool_2'] ? $data['europe']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K14', $data['europe']['inschool_3'] ? $data['europe']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L14', $data['europe']['inschool_4'] ? $data['europe']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M14', $data['europe']['inschool_5'] ? $data['europe']['inschool_5'] : null);
        //第15行
        $objPHPExcel->getActiveSheet()->setCellValue('B14', '北美洲');
        $objPHPExcel->getActiveSheet()->setCellValue('C15', $data['north_america']['sequence'] ? $data['north_america']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D15', $data['north_america']['graduate'] ? $data['north_america']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E15', $data['north_america']['degree'] ? $data['north_america']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F15', $data['north_america']['admission'] ? $data['north_america']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G15', $data['north_america']['admission_spring'] ? $data['north_america']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H15', $data['north_america']['inschool'] ? $data['north_america']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I15', $data['north_america']['inschool_1'] ? $data['north_america']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J15', $data['north_america']['inschool_2'] ? $data['north_america']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K15', $data['north_america']['inschool_3'] ? $data['north_america']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L15', $data['north_america']['inschool_4'] ? $data['north_america']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M15', $data['north_america']['inschool_5'] ? $data['north_america']['inschool_5'] : null);
        //第16行
        $objPHPExcel->getActiveSheet()->setCellValue('B16', '南美洲');
        $objPHPExcel->getActiveSheet()->setCellValue('C16', $data['south_america']['sequence'] ? $data['south_america']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D16', $data['south_america']['graduate'] ? $data['south_america']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E16', $data['south_america']['degree'] ? $data['south_america']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F16', $data['south_america']['admission'] ? $data['south_america']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G16', $data['south_america']['admission_spring'] ? $data['south_america']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H16', $data['south_america']['inschool'] ? $data['south_america']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I16', $data['south_america']['inschool_1'] ? $data['south_america']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J16', $data['south_america']['inschool_2'] ? $data['south_america']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K16', $data['south_america']['inschool_3'] ? $data['south_america']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L16', $data['south_america']['inschool_4'] ? $data['south_america']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M16', $data['south_america']['inschool_5'] ? $data['south_america']['inschool_5'] : null);
        //第17行
        $objPHPExcel->getActiveSheet()->setCellValue('B17', '大洋洲');
        $objPHPExcel->getActiveSheet()->setCellValue('C17', $data['oceania']['sequence'] ? $data['oceania']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D17', $data['oceania']['graduate'] ? $data['oceania']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E17', $data['oceania']['degree'] ? $data['oceania']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F17', $data['oceania']['admission'] ? $data['oceania']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G17', $data['oceania']['admission_spring'] ? $data['oceania']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H17', $data['oceania']['inschool'] ? $data['oceania']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I17', $data['oceania']['inschool_1'] ? $data['oceania']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J17', $data['oceania']['inschool_2'] ? $data['oceania']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K17', $data['oceania']['inschool_3'] ? $data['oceania']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L17', $data['oceania']['inschool_4'] ? $data['oceania']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M17', $data['oceania']['inschool_5'] ? $data['oceania']['inschool_5'] : null);
        //第18行
        $objPHPExcel->getActiveSheet()->mergeCells('A18:A22');
        $objPHPExcel->getActiveSheet()->setCellValue('A18', '按经费来源分');
        $objPHPExcel->getActiveSheet()->setCellValue('B18', '国际组织资助');
        $objPHPExcel->getActiveSheet()->setCellValue('C18', $data['international_organization']['sequence'] ? $data['international_organization']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D18', $data['international_organization']['graduate'] ? $data['international_organization']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E18', $data['international_organization']['degree'] ? $data['international_organization']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F18', $data['international_organization']['admission'] ? $data['international_organization']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G18', $data['international_organization']['admission_spring'] ? $data['international_organization']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H18', $data['international_organization']['inschool'] ? $data['international_organization']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I18', $data['international_organization']['inschool_1'] ? $data['international_organization']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J18', $data['international_organization']['inschool_2'] ? $data['international_organization']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K18', $data['international_organization']['inschool_3'] ? $data['international_organization']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L18', $data['international_organization']['inschool_4'] ? $data['international_organization']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M18', $data['international_organization']['inschool_5'] ? $data['international_organization']['inschool_5'] : null);
        //第19行
        $objPHPExcel->getActiveSheet()->setCellValue('B19', '中国政府资助');
        $objPHPExcel->getActiveSheet()->setCellValue('C19', $data['chinese_government']['sequence'] ? $data['chinese_government']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D19', $data['chinese_government']['graduate'] ? $data['chinese_government']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E19', $data['chinese_government']['degree'] ? $data['chinese_government']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F19', $data['chinese_government']['admission'] ? $data['chinese_government']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G19', $data['chinese_government']['admission_spring'] ? $data['chinese_government']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H19', $data['chinese_government']['inschool'] ? $data['chinese_government']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I19', $data['chinese_government']['inschool_1'] ? $data['chinese_government']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J19', $data['chinese_government']['inschool_2'] ? $data['chinese_government']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K19', $data['chinese_government']['inschool_3'] ? $data['chinese_government']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L19', $data['chinese_government']['inschool_4'] ? $data['chinese_government']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M19', $data['chinese_government']['inschool_5'] ? $data['chinese_government']['inschool_5'] : null);
        //第20行
        $objPHPExcel->getActiveSheet()->setCellValue('B20', '本国政府资助');
        $objPHPExcel->getActiveSheet()->setCellValue('C20', $data['home_government']['sequence'] ? $data['home_government']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D20', $data['home_government']['graduate'] ? $data['home_government']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E20', $data['home_government']['degree'] ? $data['home_government']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F20', $data['home_government']['admission'] ? $data['home_government']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G20', $data['home_government']['admission_spring'] ? $data['home_government']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H20', $data['home_government']['inschool'] ? $data['home_government']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I20', $data['home_government']['inschool_1'] ? $data['home_government']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J20', $data['home_government']['inschool_2'] ? $data['home_government']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K20', $data['home_government']['inschool_3'] ? $data['home_government']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L20', $data['home_government']['inschool_4'] ? $data['home_government']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M20', $data['home_government']['inschool_5'] ? $data['home_government']['inschool_5'] : null);
        //第21行
        $objPHPExcel->getActiveSheet()->setCellValue('B21', '学校间交换');
        $objPHPExcel->getActiveSheet()->setCellValue('C21', $data['exchange']['sequence'] ? $data['exchange']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D21', $data['exchange']['graduate'] ? $data['exchange']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E21', $data['exchange']['degree'] ? $data['exchange']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F21', $data['exchange']['admission'] ? $data['exchange']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G21', $data['exchange']['admission_spring'] ? $data['exchange']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H21', $data['exchange']['inschool'] ? $data['exchange']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I21', $data['exchange']['inschool_1'] ? $data['exchange']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J21', $data['exchange']['inschool_2'] ? $data['exchange']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K21', $data['exchange']['inschool_3'] ? $data['exchange']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L21', $data['exchange']['inschool_4'] ? $data['exchange']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M21', $data['exchange']['inschool_5'] ? $data['exchange']['inschool_5'] : null);
        //第22行
        $objPHPExcel->getActiveSheet()->setCellValue('B22', '学校间交换');
        $objPHPExcel->getActiveSheet()->setCellValue('C22', $data['own']['sequence'] ? $data['own']['sequence'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('D22', $data['own']['graduate'] ? $data['own']['graduate'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('E22', $data['own']['degree'] ? $data['own']['degree'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('F22', $data['own']['admission'] ? $data['own']['admission'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('G22', $data['own']['admission_spring'] ? $data['own']['admission_spring'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('H22', $data['own']['inschool'] ? $data['own']['inschool'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('I22', $data['own']['inschool_1'] ? $data['own']['inschool_1'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('J22', $data['own']['inschool_2'] ? $data['own']['inschool_2'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('K22', $data['own']['inschool_3'] ? $data['own']['inschool_3'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('L22', $data['own']['inschool_4'] ? $data['own']['inschool_4'] : null);
        $objPHPExcel->getActiveSheet()->setCellValue('M22', $data['own']['inschool_5'] ? $data['own']['inschool_5'] : null);
        $excel_name = $name . '统计信息' . date('-Ymd') . ".xls";
        $objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
        header("Content-Type: application/force-download");
        header("Content-Type: application/octet-stream");
        header("Content-Type: application/download");
        header('Content-Disposition:inline;filename="' . $excel_name . '"');
        $objWriter->save("php://output");
        $objPHPExcel->disconnectWorksheets();
        unset($objPHPExcel);
        return;
    }
 public function getDeletedatabasebyid(Request $request)
 {
     if ($request->has('id')) {
         $id = $request->get('id');
     } else {
         return;
     }
     $table = Generatedtable::find($id);
     if (Auth::user()->role != "root") {
         return Redirect::back()->withInput()->withErrors(['删除失败!非法操作!']);
     }
     $table_name = $table->table_name;
     if ($table->delete()) {
         Schema::dropIfExists($table_name);
         return Redirect::back();
     } else {
         return Redirect::back()->withErrors(['删除失败!']);
     }
 }