1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-25 12:09:09 +08:00
course-tencent-cloud/app/Console/Tasks/ResetDemoAccountTask.php
2021-02-23 17:05:00 +08:00

75 lines
2.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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#、ASPNET和SQL Server等 负责开发“QQ概念版”、“Q+”、“影视中心”、“QQ互联”等产品';
$user->avatar = '/img/avatar/202001251155458851.jpg';
$user->update();
}
}