From dc02e19a8598844dbe44f3b939d3c8e92cd3ef28 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Fri, 18 Jul 2025 10:50:10 +0800 Subject: [PATCH] update --- .../Controllers/Admin/OtherController.php | 31 +++++++++++++++++ ...25_07_17_162734_create_companies_table.php | 17 +++++++++- ..._07_18_102212_alert_course_types_table.php | 33 +++++++++++++++++++ routes/api.php | 2 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2025_07_18_102212_alert_course_types_table.php diff --git a/app/Http/Controllers/Admin/OtherController.php b/app/Http/Controllers/Admin/OtherController.php index 79c40e2..6651166 100755 --- a/app/Http/Controllers/Admin/OtherController.php +++ b/app/Http/Controllers/Admin/OtherController.php @@ -7,6 +7,8 @@ use App\Models\Admin; use App\Models\Appointment; use App\Models\AppointmentConfig; use App\Models\CarparkLog; +use App\Models\CourseSign; +use App\Models\CourseType; use App\Models\CustomFormField; use App\Models\Department; use App\Models\User; @@ -20,6 +22,35 @@ use Illuminate\Filesystem\Filesystem; class OtherController extends CommonController { + /** + * @OA\Get( + * path="/api/admin/other/home", + * tags={"其他"}, + * summary="驾驶舱", + * description="", + * @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"), + * @OA\Response( + * response="200", + * description="暂无" + * ) + * ) + */ + public function home() + { + // 校友总数 + $schoolmateTotal = User::where('is_schoolmate', 1)->count(); + // 2025年校友数 + $schoolmateTotalYear = User::where('is_schoolmate', 1)->where('created_at', 'like', '%' . date('Y') . '%')->count(); + // 课程统计 + $courseTypes = CourseType::with('courses')->where('is_chart')->get(); + foreach ($courseTypes as $courseType) { + $courseType->course_signs_total = CourseSign::where('course_id', $courseType->courses->pluck('id')) + ->where('status', 1) + ->count(); + } + return $this->success(compact('courseTypes', 'schoolmateTotal', 'schoolmateTotalYear')); + } + /** * @OA\Post( * path="/api/admin/other/admin-user-list", diff --git a/database/migrations/2025_07_17_162734_create_companies_table.php b/database/migrations/2025_07_17_162734_create_companies_table.php index d962fc2..347f54f 100644 --- a/database/migrations/2025_07_17_162734_create_companies_table.php +++ b/database/migrations/2025_07_17_162734_create_companies_table.php @@ -19,7 +19,7 @@ return new class extends Migration { // 企业名字 $table->string('company_name')->nullable()->comment('企业名字'); // 行业类型 - $table->string('company_type')->nullable()->comment('行业类型'); + $table->string('company_attribute')->nullable()->comment('行业类型'); // 标签 $table->string('company_tag')->nullable()->comment('标签'); // 企业规模 @@ -32,6 +32,21 @@ return new class extends Migration { $table->string('management_platform')->nullable()->comment('管理平台'); // 项目经理 $table->string('project_manager')->nullable()->comment('项目经理'); + + $table->bigInteger('market_value')->nullable()->comment('市值'); + $table->bigInteger('company_fund')->nullable()->comment('公司融资情况'); + $table->bigInteger('valuation')->nullable()->comment('估值'); + $table->string('company_address')->nullable()->comment('公司地址'); + $table->string('company_area')->nullable()->comment('公司区域'); + + $table->string('company_type')->nullable()->comment('公司性质-上市,拟上市'); + $table->string('company_industry')->nullable()->comment('公司所属行业'); + $table->string('company_need_fund')->nullable()->comment('公司是否需要融资-0否1是'); + $table->text('company_introduce')->nullable()->comment('公司简介'); + $table->string('company_other')->nullable()->comment('其他'); + $table->text('company_product')->nullable()->comment('产品'); + $table->string('overseas_experience')->nullable()->comment('海外经验'); + $table->string('sales_volume')->nullable()->comment('销售额'); $table->timestamps(); $table->softDeletes(); }); diff --git a/database/migrations/2025_07_18_102212_alert_course_types_table.php b/database/migrations/2025_07_18_102212_alert_course_types_table.php new file mode 100644 index 0000000..0b2c1ff --- /dev/null +++ b/database/migrations/2025_07_18_102212_alert_course_types_table.php @@ -0,0 +1,33 @@ +boolean('is_chart')->default(true)->comment('是否参与统计0否1是'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('course_types', function (Blueprint $table) { + // + }); + } +}; diff --git a/routes/api.php b/routes/api.php index 54a91d4..09f7642 100755 --- a/routes/api.php +++ b/routes/api.php @@ -34,6 +34,8 @@ Route::group(["namespace" => "Admin", "prefix" => "admin"], function () { Route::get('users/index', [\App\Http\Controllers\Admin\UserController::class, "index"]); Route::get('other/table-fileds', [\App\Http\Controllers\Admin\OtherController::class, "tableFileds"]); + Route::get('other/home', [\App\Http\Controllers\Admin\OtherController::class, "home"]); + // 验证码登陆 Route::get('auth/sms-login', [\App\Http\Controllers\Admin\AuthController::class, "smsLogin"]); Route::get('auth/send-sms', [\App\Http\Controllers\Admin\AuthController::class, "sendSms"]);