|
|
|
|
@ -7,13 +7,16 @@ use App\Models\Admin;
|
|
|
|
|
use App\Models\Appointment;
|
|
|
|
|
use App\Models\AppointmentConfig;
|
|
|
|
|
use App\Models\CarparkLog;
|
|
|
|
|
use App\Models\Company;
|
|
|
|
|
use App\Models\CourseSign;
|
|
|
|
|
use App\Models\CourseType;
|
|
|
|
|
use App\Models\CustomFormField;
|
|
|
|
|
use App\Models\Department;
|
|
|
|
|
use App\Models\ParameterDetail;
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use App\Repositories\DoorRepository;
|
|
|
|
|
use App\Repositories\EntranceRepository;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
|
use App\Models\Course;
|
|
|
|
|
use EasyWeChat\Factory;
|
|
|
|
|
@ -38,9 +41,30 @@ class OtherController extends CommonController
|
|
|
|
|
public function home()
|
|
|
|
|
{
|
|
|
|
|
// 校友总数
|
|
|
|
|
$schoolmateTotal = User::where('is_schoolmate', 1)->count();
|
|
|
|
|
$schoolmate['schoolmate_total'] = User::where('is_schoolmate', 1)->count();
|
|
|
|
|
// 2025年校友数
|
|
|
|
|
$schoolmateTotalYear = User::where('is_schoolmate', 1)->where('created_at', 'like', '%' . date('Y') . '%')->count();
|
|
|
|
|
$schoolmate['schoolmate_year'] = User::where('is_schoolmate', 1)->where('created_at', 'like', '%' . date('Y') . '%')->count();
|
|
|
|
|
// 上市企业总市值
|
|
|
|
|
$company['company_market'] = Company::where('company_market', 1)->sum('market_value');
|
|
|
|
|
// 校友企业总融资额
|
|
|
|
|
$company['company_fund'] = Company::where('is_schoolmate', 1)->sum('company_fund');
|
|
|
|
|
// 校友企业总估值
|
|
|
|
|
$company['valuation'] = Company::where('is_schoolmate', 1)->sum('valuation');
|
|
|
|
|
// 校友企业所属领域
|
|
|
|
|
$industryTotal = [];
|
|
|
|
|
$industries = ParameterDetail::where('parameter_id', 4)->get();
|
|
|
|
|
foreach ($industries as $item) {
|
|
|
|
|
$level2Names = ParameterDetail::where('parameter_id', 10)->where('remark', $item->value)->pluck('value');
|
|
|
|
|
$industryTotal[] = [
|
|
|
|
|
'industry' => $item->value,
|
|
|
|
|
'total' => User::whereIn('company_industry', $level2Names)->count()
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
// 追加其他领域
|
|
|
|
|
$industryTotal[] = [
|
|
|
|
|
'industry' => '其他',
|
|
|
|
|
'total' => User::count() - collect($industryTotal)->sum('total')
|
|
|
|
|
];
|
|
|
|
|
// 课程统计
|
|
|
|
|
$courseTypes = CourseType::with('courses')->where('is_chart')->get();
|
|
|
|
|
foreach ($courseTypes as $courseType) {
|
|
|
|
|
@ -48,7 +72,17 @@ class OtherController extends CommonController
|
|
|
|
|
->where('status', 1)
|
|
|
|
|
->count();
|
|
|
|
|
}
|
|
|
|
|
return $this->success(compact('courseTypes', 'schoolmateTotal', 'schoolmateTotalYear'));
|
|
|
|
|
// 苏州区域数据
|
|
|
|
|
$suzhou = Company::where('company_city', '苏州市')
|
|
|
|
|
// 根据company_area分组查询公司数量
|
|
|
|
|
->select('company_area', DB::raw('count(*) as company_total'))
|
|
|
|
|
->groupBy('company_area')
|
|
|
|
|
->get();
|
|
|
|
|
// 全国数据
|
|
|
|
|
$country = Company::select('company_city', DB::raw('count(*) as company_total'))
|
|
|
|
|
->groupBy('company_city')
|
|
|
|
|
->get();
|
|
|
|
|
return $this->success(compact('courseTypes', 'schoolmate', 'company', 'industryTotal', 'suzhou', 'country'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|