Compare commits

..

No commits in common. '2b46017fb2191a02b8dd2d583055d320f6d21d7c' and 'ea56e94e199ffbedbe9bd5b7f5c0b402112fdfb8' have entirely different histories.

@ -236,10 +236,7 @@ class UpdateCompany extends Command
$updatedCount = 0;
foreach ($companies as $company) {
$hasStockCode = preg_match($stockCodePattern, $company->company_tag);
// 检查是否包含"新三板"
$hasXinsanban = strpos($company->company_tag, '新三板') !== false;
// 如果匹配到股票代码或包含"新三板",则标记为上市
$newMarketStatus = ($hasStockCode || $hasXinsanban) ? 1 : 0;
$newMarketStatus = $hasStockCode ? 1 : 0;
// 只有状态变化才更新
if ($company->company_market != $newMarketStatus) {

@ -140,20 +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') . '%')
->get();
// 课程统计
$courseTypes = CourseType::where('is_chart', 1)
->orderBy('sort', 'asc')
->where('is_history', 0)->get();
$courseTypes = CourseType::where('is_chart', 1)->where('is_history', 0)->get();
// 默认开始时间
$start_date = CourseType::START_DATE;
// 默认结束日期一年以后
@ -165,11 +157,11 @@ class OtherController extends CommonController
$query->where('name', 'like', '%' . $courseType->name . '%');
})->get();
// 课程
$courses = Course::where('type', $courseType->id)->where('is_chart', 1)->get();
$courses = Course::where('type', $courseType->id)->get();
// 历史课程期数
$courseType->history_course_periods_total = $historyCourse->count();
// 现在课程数据
$courseType->now_course_periods_total = Course::where('type', $courseType->id)->where('is_chart', 1)->count();
$courseType->now_course_periods_total = Course::where('type', $courseType->id)->count();
// 历史课程培养人数去重
$courseType->history_course_signs_total = $historyCourse->sum('course_type_signs_pass_unique');
@ -307,7 +299,7 @@ class OtherController extends CommonController
$query->whereBetween('start_date', [$start_date, $end_date])
->orWhereBetween('end_date', [$start_date, $end_date]);
}
})->where('is_chart', 1)->orderBy('start_date', 'asc')->get();
})->orderBy('start_date', 'asc')->get();
foreach ($courses2 as $course) {
$courseTypesSum[] = [
'course_type' => $courseType->name,
@ -467,9 +459,8 @@ class OtherController extends CommonController
$data[] = [
'user_name' => $sign->user->name ?? '',
'mobile' => $sign->user->mobile ?? '',
'company_name' => $sign->user->company->company_name ?? '',
'company_area' => $sign->user->company->company_area ?? '',
'company_industry' => $sign->user->company->company_industry ?? '',
'company_name' => $sign->user->company_name ?? '',
'company_area' => $sign->user->company_area ?? '',
'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') : '',
@ -510,9 +501,9 @@ class OtherController extends CommonController
$data[] = [
'user_name' => $user->name ?? '',
'mobile' => $user->mobile ?? '',
'company_name' => $user->company->company_name ?? '',
'company_area' => $user->company->company_area ?? '',
'company_industry' => $user->company->company_industry ?? '',
'company_name' => $user->company_name ?? '',
'company_area' => $user->company_area ?? '',
'company_industry' => $user->company_industry ?? '',
'course_names' => $courseNames,
'course_count' => $userCourseSigns->count(),
];

@ -87,7 +87,6 @@ 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])
@ -297,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');
}
// 获取这些公司中标记为被投的公司
@ -321,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;
@ -399,7 +398,7 @@ class CourseSign extends SoftDeletesModel
* @param bool $retList 是否返回列表false返回数量true返回列表
* @return int|\Illuminate\Database\Eloquent\Collection
*/
public static function genban($start_date = null, $end_date = null, $course_ids = null, $retList = false)
public static function genban($start_date, $end_date, $course_ids = null, $retList = false)
{
$courseSignsQuery = self::getStudentList($start_date, $end_date, 1, $course_ids);
// 获取需要统计跟班学员的课程

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('course_types', function (Blueprint $table) {
$table->integer('sort')->default(1)->comment('排序');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('course_types', function (Blueprint $table) {
$table->dropColumn('sort');
});
}
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save