feat: 在 Task2 类中添加自动删除用户配置查询逻辑

This commit is contained in:
lingling 2025-03-10 21:06:24 +08:00
parent 46a4ba7694
commit 755cf15794
1 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,7 @@ use app\dao\UserPhoneLogDao;
use App\Utils\API\SendCode;
use app\model\UserPhone;
use app\dao\UserRewardDao;
use app\model\Dictionary;
use support\Log;
use Workerman\Crontab\Crontab;
use GuzzleHttp\Client;
@ -22,6 +23,8 @@ class Task2
new Crontab('0 */1 * * * *', function () {
$start_time = time();
Rocketgo::test_login();
//查询系统配置 是否自动删除用户
$autodelete=Dictionary::where('key','autodelete')->first();
Log::info("查询任务开始");
// 获取账号列表
$res = Rocketgo::account_list();
@ -44,7 +47,7 @@ class Task2
$updateData = [];
foreach ($res as $v) {
if ($v['failedReason'] !== null) {
if ($v['failedReason'] !== null && $autodelete->value=='1') {
SendCode::delWS($v['username']);
continue;
}