Compare commits

..

11 Commits

Author SHA1 Message Date
cody 2b46017fb2 Merge branch 'master' of 101.132.227.52:tanyuan/wx.sstbc.com
5 days ago
cody b1619ab7cf update
5 days ago
cody e43879d71b update
5 days ago
cody b424946220 Merge branch 'master' of ssh://47.101.48.251:/data/git/wx.sstbc.com
5 days ago
cody f941ff20fc update
5 days ago
lion 4601fe1333 Merge branch 'master' of ssh://47.101.48.251:/data/git/wx.sstbc.com
1 week ago
lion 258ac8fd2d 更改
1 week ago
cody b1fe134caa Merge branch 'master' of ssh://47.101.48.251:/data/git/wx.sstbc.com
1 week ago
cody fde517f253 update
1 week ago
lion c5a045ec7c Merge branch 'master' of ssh://47.101.48.251:/data/git/wx.sstbc.com
1 week ago
lion d6b688dbda 更改
1 week ago

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

@ -140,12 +140,20 @@ 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)->where('is_history', 0)->get();
$courseTypes = CourseType::where('is_chart', 1)
->orderBy('sort', 'asc')
->where('is_history', 0)->get();
// 默认开始时间
$start_date = CourseType::START_DATE;
// 默认结束日期一年以后
@ -157,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');
@ -299,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,
@ -459,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') : '',
@ -501,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(),
];

@ -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])
@ -398,7 +399,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);
// 获取需要统计跟班学员的课程

@ -0,0 +1,32 @@
<?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