master
cody 3 weeks ago
parent 7d4a73a0c4
commit 865afaccf8

@ -7,6 +7,7 @@ use App\Jobs\CancelAppointMeet;
use App\Models\Admin;
use App\Models\Appointment;
use App\Models\AppointmentConfig;
use App\Models\Article;
use App\Models\Calendar;
use App\Models\CarparkLog;
use App\Models\Company;
@ -15,6 +16,7 @@ use App\Models\CourseType;
use App\Models\CustomFormField;
use App\Models\Department;
use App\Models\ParameterDetail;
use App\Models\SupplyDemand;
use App\Models\User;
use App\Repositories\DoorRepository;
use App\Repositories\EntranceRepository;
@ -159,7 +161,36 @@ class OtherController extends CommonController
})->where('is_schoolmate', 1)->count()
];
}
return $this->success(compact('courseTypes', 'schoolmate', 'suzhou', 'country'));
// 本月课程
$monthCourses = Course::with('teacher')->where('start_date', 'like', '%' . date('Y-m') . '%')->get();
// 投后企业
$yuanhe['yh_invested_total'] = Company::where('is_yh_invested', 1)->count();
// 元和员工参与企业
$companyNameKeyword = ['元禾控股', '元禾原点', '元禾厚望', '元禾重元', '元禾璞华', '元禾谷风', '元禾绿柳', '元禾辰坤', '元禾沙湖', '禾裕集团', '苏州科服', '信诚管理咨询', '集成电路公司', '常州团队', '国企元禾'];
// 获取公司名字包含$companyNameKeyword任意数据的公司需要模糊匹配
$yuanhe['yh_join_company_total'] = Company::where(function ($query) use ($companyNameKeyword) {
foreach ($companyNameKeyword as $item) {
$query->orWhere('company_name', 'like', '%' . $item . '%');
}
})->count();
// 全市干部参与企业
$yuanhe['yh_ganbu_total'] = Company::whereHas('users', function ($query) {
$query->where('from', '跟班学员');
})->count();
// 三个全覆盖
// 苏州头部企业
$cover['head_total'] = 0;
// 高层次人才
$cover['high_total'] = 0;
// 重点上市公司
$cover['stock_total'] = 0;
// 时间轴
$time_axis = [];
// 动态信息
$article['xiaoyou'] = Article::where('type', 1)->limit(7)->orderBy('created_at', 'desc')->get();
$article['yejie'] = Article::where('type', 2)->limit(7)->orderBy('created_at', 'desc')->get();
$article['supply_demands'] = SupplyDemand::limit(7)->orderBy('created_at', 'desc')->get();
return $this->success(compact('courseTypes', 'schoolmate', 'suzhou', 'country', 'monthCourses', 'yuanhe', 'time_axis'));
}
/**

@ -0,0 +1,7 @@
<?php
namespace App\Models;
class Article extends SoftDeletesModel
{
}

@ -0,0 +1,35 @@
<?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::create('articles', function (Blueprint $table) {
$table->id();
$table->string('title')->comment('标题');
$table->text('content')->nullable()->comment('内容');
// 类型
$table->tinyInteger('type')->default(0)->comment('类型1校友动态2业界动态');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('articles');
}
};
Loading…
Cancel
Save