master
cody 3 months ago
parent c8ae055341
commit 160f7f2d6d

@ -42,13 +42,15 @@ class UpdateUserNo extends Command
*/
public function handle()
{
// 已经开始的课程日期
$dateList = Course::whereNotNull('start_date')
->where('start_date', '<=', date('Y-m-d'))
->orderBy('start_date')
->groupBy('start_date')
->pluck('start_date')
->toArray();
// 已经开始的课程日期(所有历史数据处理)
// $dateList = Course::whereNotNull('start_date')
// ->where('start_date', '<=', date('Y-m-d'))
// ->orderBy('start_date')
// ->groupBy('start_date')
// ->pluck('start_date')
// ->toArray();
// 当日数据处理(日常定时任务)
$dateList = [date('Y-m-d')];
foreach ($dateList as $date) {
$courses = Course::with(['courseSigns' => function ($query) {
$query->where('status', 1);

@ -26,6 +26,8 @@ class Kernel extends ConsoleKernel
$schedule->command('send_email')->everyMinute();
// 推送课程人员信息
$schedule->command('push_courses')->dailyAt('23:00');
// 更新学员编号
$schedule->command('update_user_no')->dailyAt('00:05');
}
/**

Loading…
Cancel
Save