master
cody 5 days ago
parent b1fe134caa
commit f941ff20fc

@ -140,6 +140,12 @@ class OtherController extends CommonController
$list['cover_rencai_total'] = CourseSign::rencai();
// 重点上市公司
$list['cover_stock_total'] = CourseSign::shangshi();
// 培养人次
$list['course_signs_pass'] = CourseSign::courseSignsTotal(null, null, 1);
// 培养人数
$list['course_signs_pass_unique'] = CourseSign::courseSignsTotalByUnique(null, null, 1, null, null);
// 跟班学员数
$list['genban_total'] = CourseSign::genban();
// 本月课程
$monthCourses = Calendar::with('course.teacher')
->where('start_time', 'like', '%' . date('Y-m') . '%')

@ -296,15 +296,15 @@ class CourseSign extends SoftDeletesModel
$years = [];
if ($start_date && $end_date) {
// 从开始和结束日期中提取年份范围
$startYear = (int) date('Y', strtotime($start_date));
$endYear = (int) date('Y', strtotime($end_date));
$startYear = (int)date('Y', strtotime($start_date));
$endYear = (int)date('Y', strtotime($end_date));
// 生成所有年份的数组
for ($year = $startYear; $year <= $endYear; $year++) {
$years[] = $year;
}
} else {
// 如果没有提供日期,使用当前年份
$years[] = (int) date('Y');
$years[] = (int)date('Y');
}
// 获取这些公司中标记为被投的公司
@ -320,7 +320,7 @@ class CourseSign extends SoftDeletesModel
foreach ($projectUsers as $item) {
$investDate = $item['investDate'] ?? null;
if ($investDate) {
$investYear = (int) date('Y', strtotime($investDate));
$investYear = (int)date('Y', strtotime($investDate));
if (in_array($investYear, $years)) {
$hasInvestInYears = true;
break;
@ -398,7 +398,7 @@ class CourseSign extends SoftDeletesModel
* @param bool $retList 是否返回列表false返回数量true返回列表
* @return int|\Illuminate\Database\Eloquent\Collection
*/
public static function genban($start_date, $end_date, $course_ids = null, $retList = false)
public static function genban($start_date = null, $end_date = null, $course_ids = null, $retList = false)
{
$courseSignsQuery = self::getStudentList($start_date, $end_date, 1, $course_ids);
// 获取需要统计跟班学员的课程

Loading…
Cancel
Save