|
|
|
@ -9,6 +9,7 @@ use App\Models\AppointmentType;
|
|
|
|
use App\Models\Book;
|
|
|
|
use App\Models\Book;
|
|
|
|
use App\Models\Calendar;
|
|
|
|
use App\Models\Calendar;
|
|
|
|
use App\Models\Company;
|
|
|
|
use App\Models\Company;
|
|
|
|
|
|
|
|
use App\Models\Course;
|
|
|
|
use App\Models\CourseContentEvaluationAsk;
|
|
|
|
use App\Models\CourseContentEvaluationAsk;
|
|
|
|
use App\Models\CourseContentEvaluationForm;
|
|
|
|
use App\Models\CourseContentEvaluationForm;
|
|
|
|
use App\Models\CourseSign;
|
|
|
|
use App\Models\CourseSign;
|
|
|
|
@ -283,8 +284,14 @@ class CompanyController extends BaseController
|
|
|
|
$start_date = $start_year ? $start_year . '-01-01' : date('Y-01-01');
|
|
|
|
$start_date = $start_year ? $start_year . '-01-01' : date('Y-01-01');
|
|
|
|
$end_date = $end_year ? $end_year . '-12-31' : date('Y-m-d');
|
|
|
|
$end_date = $end_year ? $end_year . '-12-31' : date('Y-m-d');
|
|
|
|
if ($start_date && $end_date) {
|
|
|
|
if ($start_date && $end_date) {
|
|
|
|
// 累计被投企业数(从起始日期到结束日期)
|
|
|
|
// 累计被投企业数(与 CourseSign::yhInvestedTotal / courses-home 口径一致:getStudentList 学员 + 被投企业)
|
|
|
|
$investedCompanies = Company::yhInvestedTotal($end_date, true);
|
|
|
|
$course_ids = null;
|
|
|
|
|
|
|
|
if (!empty($all['course_type_id'])) {
|
|
|
|
|
|
|
|
$tid = is_array($all['course_type_id']) ? $all['course_type_id'] : explode(',', (string) $all['course_type_id']);
|
|
|
|
|
|
|
|
$tid = array_filter(array_map('trim', $tid));
|
|
|
|
|
|
|
|
$course_ids = $tid ? Course::whereIn('type', $tid)->pluck('id')->toArray() : null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$investedCompanies = CourseSign::yhInvestedTotal(CourseType::START_DATE, $end_date, $course_ids, true);
|
|
|
|
if ($investedCompanies) {
|
|
|
|
if ($investedCompanies) {
|
|
|
|
$investedCompaniesCollection = collect($investedCompanies);
|
|
|
|
$investedCompaniesCollection = collect($investedCompanies);
|
|
|
|
$statistics['course_signs_invested'] = $investedCompaniesCollection->count();
|
|
|
|
$statistics['course_signs_invested'] = $investedCompaniesCollection->count();
|
|
|
|
|