mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-24 20:06:09 +08:00
第三方开放登录增加公众号通知
顺延演示直播课程日期
This commit is contained in:
parent
64788106c8
commit
aab39aee93
65
app/Console/Tasks/RenewLiveCourseDemoTask.php
Normal file
65
app/Console/Tasks/RenewLiveCourseDemoTask.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Tasks;
|
||||
|
||||
use App\Caches\CourseChapterList as CourseChapterListCache;
|
||||
use App\Repos\Chapter as ChapterRepo;
|
||||
use App\Repos\Course as CourseRepo;
|
||||
use App\Services\CourseStat as CourseStatService;
|
||||
|
||||
class RenewLiveCourseDemoTask extends Task
|
||||
{
|
||||
|
||||
/**
|
||||
* 25号顺延直播课程日期(日期顺延一个月)
|
||||
*/
|
||||
public function mainAction()
|
||||
{
|
||||
$day = date('d');
|
||||
|
||||
if ($day != 25) return;
|
||||
|
||||
$courseRepo = new CourseRepo();
|
||||
|
||||
$course = $courseRepo->findById(1393);
|
||||
|
||||
$chapters = $courseRepo->findLessons($course->id);
|
||||
|
||||
$chapterRepo = new ChapterRepo();
|
||||
|
||||
foreach ($chapters as $chapter) {
|
||||
|
||||
$live = $chapterRepo->findChapterLive($chapter->id);
|
||||
|
||||
if ($live->start_time > time()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$startTime = strtotime('+1 month', $live->start_time);
|
||||
$endTime = strtotime('+1 month', $live->end_time);
|
||||
|
||||
$live->start_time = $startTime;
|
||||
$live->end_time = $endTime;
|
||||
|
||||
$live->update();
|
||||
|
||||
$attrs = $chapter->attrs;
|
||||
|
||||
$attrs['start_time'] = $startTime;
|
||||
$attrs['end_time'] = $endTime;
|
||||
|
||||
$chapter->attrs = $attrs;
|
||||
|
||||
$chapter->update();
|
||||
}
|
||||
|
||||
$statService = new CourseStatService();
|
||||
|
||||
$statService->updateLiveAttrs($course->id);
|
||||
|
||||
$cache = new CourseChapterListCache();
|
||||
|
||||
$cache->rebuild($course->id);
|
||||
}
|
||||
|
||||
}
|
@ -101,7 +101,7 @@ class Setting extends Service
|
||||
*/
|
||||
if ($items->count() > 0) {
|
||||
foreach ($items as $item) {
|
||||
$case1 = preg_match('/(id|auth|key|secret|password|pwd)$/', $item->item_key);
|
||||
$case1 = preg_match('/(id|auth|key|secret|token|password|pwd)$/', $item->item_key);
|
||||
$case2 = $this->dispatcher->getControllerName() == 'setting';
|
||||
if ($case1 && $case2) {
|
||||
$item->item_value = '***';
|
||||
|
@ -52,4 +52,7 @@ $scheduler->php($script, $bin, ['--task' => 'revoke_vip', '--action' => 'main'])
|
||||
$scheduler->php($script, $bin, ['--task' => 'sitemap', '--action' => 'main'])
|
||||
->daily(4, 3);
|
||||
|
||||
$scheduler->php($script, $bin, ['--task' => 'renew_live_course_demo', '--action' => 'main'])
|
||||
->daily(4, 7);
|
||||
|
||||
$scheduler->run();
|
Loading…
x
Reference in New Issue
Block a user