master
cody 2 weeks ago
parent a627852c36
commit 69deacb2f5

@ -61,7 +61,19 @@ class CalendarsController extends BaseController
$list = $list->toArray();
return Excel::download(new CommonExport($list, $all['export_fields'] ?? ''), ($all['file_name'] ?? '') . date('YmdHis') . '.xlsx');
}
return $this->success($list);
// 本月日历天数
$monthDayCalendar = Calendar::where(function ($query) use ($all) {
if (isset($all['month'])) {
$query->where('start_time', 'like', $all['month'] . '%');
}
})->where('is_count_days', 1)->sum('days');
// 本年日历天数
$yearDayCalendar = Calendar::where(function ($query) use ($all) {
if (isset($all['month'])) {
$query->where('start_time', 'like', $all['month'] . '%');
}
})->where('is_count_days', 1)->sum('days');
return $this->success(compact('list', 'monthDayCalendar', 'yearDayCalendar'));
}
/**

@ -141,7 +141,7 @@ class OtherController extends CommonController
// 重点上市公司
$list['cover_stock_total'] = CourseSign::shangshi();
// 本月课程
$monthCourses = Calendar::with('course.teacher')->where('type', 1)
$monthCourses = Calendar::with('course.teacher')
->where('date', 'like', '%' . date('Y-m') . '%')
->get();
// 课程统计

Loading…
Cancel
Save