|
|
|
@ -121,7 +121,7 @@ class OtherController extends CommonController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 课程统计
|
|
|
|
// 课程统计
|
|
|
|
$courseTypes = CourseType::where('is_chart', 1)->get();
|
|
|
|
$courseTypes = CourseType::where('is_chart', 1)->get();
|
|
|
|
$start_date = '2020-01-01';
|
|
|
|
$start_date = CourseType::START_DATE;
|
|
|
|
$end_date = date('Y-m-d');
|
|
|
|
$end_date = date('Y-m-d');
|
|
|
|
foreach ($courseTypes as $courseType) {
|
|
|
|
foreach ($courseTypes as $courseType) {
|
|
|
|
// 课程
|
|
|
|
// 课程
|
|
|
|
@ -157,7 +157,8 @@ class OtherController extends CommonController
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 本月课程
|
|
|
|
// 本月课程
|
|
|
|
$monthCourses = Course::with('teacher')->where('start_date', 'like', '%' . date('Y-m') . '%')->get();
|
|
|
|
$monthCourses = Course::with('teacher')->where('start_date', 'like', '%' . date('Y-m') . '%')
|
|
|
|
|
|
|
|
->get();
|
|
|
|
// 时间轴
|
|
|
|
// 时间轴
|
|
|
|
$time_axis = TimeEvent::orderBy('sort', 'asc')->orderBy('id', 'desc')->get();
|
|
|
|
$time_axis = TimeEvent::orderBy('sort', 'asc')->orderBy('id', 'desc')->get();
|
|
|
|
// 动态信息
|
|
|
|
// 动态信息
|
|
|
|
@ -185,7 +186,7 @@ class OtherController extends CommonController
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function coursesHome()
|
|
|
|
public function coursesHome()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$start_date = request('start_date', '2020-01-01');
|
|
|
|
$start_date = request('start_date', CourseType::START_DATE);
|
|
|
|
$end_date = request('end_date', date('Y-m-d'));
|
|
|
|
$end_date = request('end_date', date('Y-m-d'));
|
|
|
|
$course_type_id = request('course_type_id', '');
|
|
|
|
$course_type_id = request('course_type_id', '');
|
|
|
|
if ($course_type_id) {
|
|
|
|
if ($course_type_id) {
|
|
|
|
@ -200,8 +201,7 @@ class OtherController extends CommonController
|
|
|
|
// ->where('start_date', '<=', $end_date)
|
|
|
|
// ->where('start_date', '<=', $end_date)
|
|
|
|
// ->where('start_date', '>=', $start_date)
|
|
|
|
// ->where('start_date', '>=', $start_date)
|
|
|
|
->get();
|
|
|
|
->get();
|
|
|
|
// 被投企业数
|
|
|
|
|
|
|
|
$list['course_signs_invested'] = CourseSign::yhInvested($start_date, $end_date);
|
|
|
|
|
|
|
|
// 报名人数
|
|
|
|
// 报名人数
|
|
|
|
$list['course_signs_total'] = CourseSign::courseSignsTotal($start_date, $end_date);
|
|
|
|
$list['course_signs_total'] = CourseSign::courseSignsTotal($start_date, $end_date);
|
|
|
|
// 审核通过人数
|
|
|
|
// 审核通过人数
|
|
|
|
@ -246,9 +246,7 @@ class OtherController extends CommonController
|
|
|
|
$area->course_signs_pass_unique = CourseSign::courseSignsTotalByUnique($start_date, $end_date, 1, $courses->pluck('id'), $area->value, $userIds);
|
|
|
|
$area->course_signs_pass_unique = CourseSign::courseSignsTotalByUnique($start_date, $end_date, 1, $courses->pluck('id'), $area->value, $userIds);
|
|
|
|
$area->user_ids = $userIds;
|
|
|
|
$area->user_ids = $userIds;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$area_course_signs_pass_total = collect($areas)->sum('course_signs_pass');
|
|
|
|
return $this->success(compact('list', 'courseTypesSum', 'areas'));
|
|
|
|
$area_course_signs_pass_unique_total = collect($areas)->sum('course_signs_pass_unique');
|
|
|
|
|
|
|
|
return $this->success(compact('list', 'courseTypesSum', 'areas', 'area_course_signs_pass_total', 'area_course_signs_pass_unique_total'));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|