mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-25 04:07:17 +08:00
增加重置演示帐号计划任务
This commit is contained in:
parent
1196b5138b
commit
0f1d009d7f
@ -7,7 +7,7 @@ use App\Repos\Chapter as ChapterRepo;
|
|||||||
use App\Repos\Course as CourseRepo;
|
use App\Repos\Course as CourseRepo;
|
||||||
use App\Services\CourseStat as CourseStatService;
|
use App\Services\CourseStat as CourseStatService;
|
||||||
|
|
||||||
class RenewLiveCourseDemoTask extends Task
|
class RenewDemoLiveCourseTask extends Task
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
74
app/Console/Tasks/ResetDemoAccountTask.php
Normal file
74
app/Console/Tasks/ResetDemoAccountTask.php
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Tasks;
|
||||||
|
|
||||||
|
use App\Library\Utils\Password as PasswordUtil;
|
||||||
|
use App\Repos\Account as AccountRepo;
|
||||||
|
use App\Repos\User as UserRepo;
|
||||||
|
|
||||||
|
class ResetDemoAccountTask extends Task
|
||||||
|
{
|
||||||
|
|
||||||
|
public function mainAction()
|
||||||
|
{
|
||||||
|
$this->reset_account_100015();
|
||||||
|
$this->reset_account_100065();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function reset_account_100015()
|
||||||
|
{
|
||||||
|
$accountRepo = new AccountRepo();
|
||||||
|
|
||||||
|
$account = $accountRepo->findById(100015);
|
||||||
|
|
||||||
|
$salt = PasswordUtil::salt();
|
||||||
|
$hash = PasswordUtil::hash('123456', $salt);
|
||||||
|
|
||||||
|
$account->phone = '13507083515';
|
||||||
|
$account->email = '100015@163.com';
|
||||||
|
$account->salt = $salt;
|
||||||
|
$account->password = $hash;
|
||||||
|
|
||||||
|
$account->update();
|
||||||
|
|
||||||
|
$userRepo = new UserRepo();
|
||||||
|
|
||||||
|
$user = $userRepo->findById(100015);
|
||||||
|
|
||||||
|
$user->name = '酷瓜云课堂';
|
||||||
|
$user->title = '页面重构设计';
|
||||||
|
$user->about = '酷瓜云课堂(腾讯云版),依托腾讯云基础服务架构,采用C扩展PHP框架Phalcon开发,致力开源网课系统,开源网校系统,开源在线教育系统。';
|
||||||
|
$user->avatar = '/img/avatar/20210214084718217596.jpeg';
|
||||||
|
|
||||||
|
$user->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function reset_account_100065()
|
||||||
|
{
|
||||||
|
$accountRepo = new AccountRepo();
|
||||||
|
|
||||||
|
$account = $accountRepo->findById(100065);
|
||||||
|
|
||||||
|
$salt = PasswordUtil::salt();
|
||||||
|
$hash = PasswordUtil::hash('123456', $salt);
|
||||||
|
|
||||||
|
$account->phone = '13607083515';
|
||||||
|
$account->email = '100065@163.com';
|
||||||
|
$account->salt = $salt;
|
||||||
|
$account->password = $hash;
|
||||||
|
|
||||||
|
$account->update();
|
||||||
|
|
||||||
|
$userRepo = new UserRepo();
|
||||||
|
|
||||||
|
$user = $userRepo->findById(100065);
|
||||||
|
|
||||||
|
$user->name = 'Murphy';
|
||||||
|
$user->title = '移动开发工程师';
|
||||||
|
$user->about = '腾讯开放平台高级工程师 Web技术大牛 10年风雨开发路 腾讯学院讲师 沙龙论坛演讲大V T恤男 儒雅先生 精通C#、ASP.NET和SQL Server等 负责开发“QQ概念版”、“Q+”、“影视中心”、“QQ互联”等产品';
|
||||||
|
$user->avatar = '/img/avatar/202001251155458851.jpg';
|
||||||
|
|
||||||
|
$user->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -52,6 +52,9 @@ $scheduler->php($script, $bin, ['--task' => 'sync_user_index', '--action' => 'ma
|
|||||||
$scheduler->php($script, $bin, ['--task' => 'sync_course_score', '--action' => 'main'])
|
$scheduler->php($script, $bin, ['--task' => 'sync_course_score', '--action' => 'main'])
|
||||||
->hourly(29);
|
->hourly(29);
|
||||||
|
|
||||||
|
$scheduler->php($script, $bin, ['--task' => 'reset_demo_account', '--action' => 'main'])
|
||||||
|
->hourly(59);
|
||||||
|
|
||||||
$scheduler->php($script, $bin, ['--task' => 'clean_log', '--action' => 'main'])
|
$scheduler->php($script, $bin, ['--task' => 'clean_log', '--action' => 'main'])
|
||||||
->daily(3, 3);
|
->daily(3, 3);
|
||||||
|
|
||||||
@ -64,6 +67,9 @@ $scheduler->php($script, $bin, ['--task' => 'revoke_vip', '--action' => 'main'])
|
|||||||
$scheduler->php($script, $bin, ['--task' => 'sitemap', '--action' => 'main'])
|
$scheduler->php($script, $bin, ['--task' => 'sitemap', '--action' => 'main'])
|
||||||
->daily(4, 3);
|
->daily(4, 3);
|
||||||
|
|
||||||
|
$scheduler->php($script, $bin, ['--task' => 'renew_demo_live_course', '--action' => 'main'])
|
||||||
|
->daily(4, 7);
|
||||||
|
|
||||||
$scheduler->php($script, $bin, ['--task' => 'teacher_live_notice', '--action' => 'provide'])
|
$scheduler->php($script, $bin, ['--task' => 'teacher_live_notice', '--action' => 'provide'])
|
||||||
->daily(4, 7);
|
->daily(4, 7);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user