master
cody 6 days ago
parent 302e443eaa
commit 295c89c4d4

@ -41,11 +41,11 @@ class AutoSchoolmate extends Command
*/
public function handle()
{
// 获取所有已开始且需要自动加入校友库的课程(只处理存在 start_date 的课程)
$today = date('Y-m-d');
// 获取所有明天开课且需要自动加入校友库的课程(只处理存在 start_date 的课程)
$tomorrow = date('Y-m-d', strtotime('+1 day'));
$courses = Course::where('auto_schoolmate', 1)
->whereNotNull('start_date')
->where('start_date', '<=', $today)
->where('start_date', $tomorrow)
->get();
if ($courses->isEmpty()) {

@ -159,6 +159,7 @@ class AppointmentController extends BaseController
* summary="更新或新增",
* @OA\Parameter(name="id", in="query", @OA\Schema(type="integer"), required=true, description="课程ID存在则更新不存在则新增"),
* @OA\Parameter(name="user_id", in="query", @OA\Schema(type="string", format="date"), description="用户id创建时多个用户英文逗号分隔"),
* @OA\Parameter(name="course_id", in="query", @OA\Schema(type="integer"), description="课程id"),
* @OA\Parameter(name="date", in="query", @OA\Schema(type="string", format="date"), description="预约日期"),
* @OA\Parameter(name="start_time", in="query", @OA\Schema(type="string", format="date-time"), description="开始时间,例如2023-01-01 11:11:11"),
* @OA\Parameter(name="end_time", in="query", @OA\Schema(type="string", format="date-time"), description="结束时间,例如2023-01-01 11:11:11"),

@ -0,0 +1,31 @@
<?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('appointments', function (Blueprint $table) {
$table->integer('course_id')->nullable()->after('user_id')->comment('课程id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('appointments', function (Blueprint $table) {
$table->dropColumn('course_id');
});
}
};
Loading…
Cancel
Save