diff --git a/app/Http/Controllers/Admin/OtherController.php b/app/Http/Controllers/Admin/OtherController.php index 4a5e2b1..195f425 100755 --- a/app/Http/Controllers/Admin/OtherController.php +++ b/app/Http/Controllers/Admin/OtherController.php @@ -132,10 +132,10 @@ class OtherController extends CommonController // 默认结束日期一年以后 $end_date = date('Y-m-d', strtotime('+10 year')); - // 校友总数 - $list['schoolmate_total'] = User::where('is_schoolmate', 1)->count(); - // 今年新增校友数(根据schoolmate_time字段统计) - $list['schoolmate_year'] = User::where('is_schoolmate', 1)->whereYear('schoolmate_time', date('Y'))->count(); + // 校友总数(与 study 口径一致:仅统计有课程报名记录的校友) + $list['schoolmate_total'] = User::where('is_schoolmate', 1)->whereHas('courseSigns')->count(); + // 今年新增校友数(根据schoolmate_time字段统计,口径同上) + $list['schoolmate_year'] = User::where('is_schoolmate', 1)->whereHas('courseSigns')->whereYear('schoolmate_time', date('Y'))->count(); // 投后企业 $list['company_invested_total'] = CourseSign::yhInvestedTotal(CourseType::START_DATE, date('Y-m-d'), null); // 元和员工参与人数