master
lion 5 days ago
parent e56b38f0d7
commit a7562728d3

@ -170,15 +170,21 @@ class OtherController extends CommonController
->where('start_time', 'like', '%' . date('Y-m') . '%')
->get();
// 苏州区域数据 - 使用 CourseSign::getAreaData 方法实现数据一致
$areasData = CourseSign::getAreaData($start_date, $end_date, 1, null, true, 'statistics');
// 苏州区域数据:与 courses-home 的 areas 口径保持一致
// - 使用 CourseSign::area
// - 使用全部课程体系对应课程 ID 作为过滤条件
// - 不额外限定 is_schoolmate与 courses-home areas 一致)
$courseTypeIds = CourseType::pluck('id')->toArray();
$courses = Course::whereIn('type', $courseTypeIds)->get();
$areasData = CourseSign::area($start_date, $end_date, 1, $courses->pluck('id'), true);
$suzhou = [];
foreach ($areasData as $item) {
$total = $item['total'] ?? 0;
$totalUnique = $item['total_unique'] ?? 0;
$suzhou[] = [
'area' => $item['area'],
// 保持 total 兼容旧前端,同时显式返回 total_unique
'total' => $totalUnique,
// 与 courses-home areas 字段语义一致
'total' => $total,
'total_unique' => $totalUnique,
];
}

Loading…
Cancel
Save