diff --git a/app/Http/Controllers/Admin/OtherController.php b/app/Http/Controllers/Admin/OtherController.php index f05dd38..dfef33b 100755 --- a/app/Http/Controllers/Admin/OtherController.php +++ b/app/Http/Controllers/Admin/OtherController.php @@ -165,11 +165,11 @@ class OtherController extends CommonController $query->where('name', 'like', '%' . $courseType->name . '%'); })->get(); // 课程 - $courses = Course::where('type', $courseType->id)->get(); + $courses = Course::where('type', $courseType->id)->where('is_chart', 1)->get(); // 历史课程期数 $courseType->history_course_periods_total = $historyCourse->count(); // 现在课程数据 - $courseType->now_course_periods_total = Course::where('type', $courseType->id)->count(); + $courseType->now_course_periods_total = Course::where('type', $courseType->id)->where('is_chart', 1)->count(); // 历史课程培养人数去重 $courseType->history_course_signs_total = $historyCourse->sum('course_type_signs_pass_unique'); @@ -307,7 +307,7 @@ class OtherController extends CommonController $query->whereBetween('start_date', [$start_date, $end_date]) ->orWhereBetween('end_date', [$start_date, $end_date]); } - })->orderBy('start_date', 'asc')->get(); + })->where('is_chart', 1)->orderBy('start_date', 'asc')->get(); foreach ($courses2 as $course) { $courseTypesSum[] = [ 'course_type' => $courseType->name, @@ -467,8 +467,9 @@ class OtherController extends CommonController $data[] = [ 'user_name' => $sign->user->name ?? '', 'mobile' => $sign->user->mobile ?? '', - 'company_name' => $sign->user->company_name ?? '', - 'company_area' => $sign->user->company_area ?? '', + 'company_name' => $sign->user->company->company_name ?? '', + 'company_area' => $sign->user->company->company_area ?? '', + 'company_industry' => $sign->user->company->company_industry ?? '', 'course_name' => $sign->course->name ?? '', 'course_type' => $sign->course->typeDetail->name ?? '', // 'created_at' => $sign->created_at ? $sign->created_at->format('Y-m-d H:i:s') : '', @@ -509,9 +510,9 @@ class OtherController extends CommonController $data[] = [ 'user_name' => $user->name ?? '', 'mobile' => $user->mobile ?? '', - 'company_name' => $user->company_name ?? '', - 'company_area' => $user->company_area ?? '', - 'company_industry' => $user->company_industry ?? '', + 'company_name' => $user->company->company_name ?? '', + 'company_area' => $user->company->company_area ?? '', + 'company_industry' => $user->company->company_industry ?? '', 'course_names' => $courseNames, 'course_count' => $userCourseSigns->count(), ]; diff --git a/app/Models/CourseSign.php b/app/Models/CourseSign.php index ba91021..546a2be 100755 --- a/app/Models/CourseSign.php +++ b/app/Models/CourseSign.php @@ -87,6 +87,7 @@ class CourseSign extends SoftDeletesModel $query->whereIn('course_id', $course_ids); } })->whereHas('course', function ($query) use ($start_date, $end_date) { + $query->where('is_chart', 1); // 开始结束日期的筛选。or查询 if ($start_date && $end_date) { $query->whereBetween('start_date', [$start_date, $end_date])