|
|
|
|
@ -110,7 +110,9 @@ class CourseSign extends SoftDeletesModel
|
|
|
|
|
// 基础数据
|
|
|
|
|
$baseTotal = $totalQuery->count();
|
|
|
|
|
// 历史数据
|
|
|
|
|
$historyTotal = HistoryCourse::where(function ($query) use ($start_date, $end_date) {
|
|
|
|
|
$historyTotal = HistoryCourse::where('calendar', function ($query) {
|
|
|
|
|
$query->where('is_count_people', 1);
|
|
|
|
|
})->where(function ($query) use ($start_date, $end_date) {
|
|
|
|
|
// 开始结束日期的筛选。or查询
|
|
|
|
|
$query->whereBetween('start_time', [$start_date, $end_date])
|
|
|
|
|
->orWhereBetween('end_time', [$start_date, $end_date]);
|
|
|
|
|
@ -133,7 +135,9 @@ class CourseSign extends SoftDeletesModel
|
|
|
|
|
} else {
|
|
|
|
|
$baseTotal = $user->count();
|
|
|
|
|
// 历史数据
|
|
|
|
|
$historyTotal = HistoryCourse::where(function ($query) use ($start_date, $end_date) {
|
|
|
|
|
$historyTotal = HistoryCourse::where('calendar', function ($query) {
|
|
|
|
|
$query->where('is_count_people', 1);
|
|
|
|
|
})->where(function ($query) use ($start_date, $end_date) {
|
|
|
|
|
// 开始结束日期的筛选。or查询
|
|
|
|
|
$query->whereBetween('start_time', [$start_date, $end_date])
|
|
|
|
|
->orWhereBetween('end_time', [$start_date, $end_date]);
|
|
|
|
|
|