<?php namespace process; use App\Utils\API\SendCode; use app\model\UserPhone; use app\dao\UserRewardDao; use Workerman\Crontab\Crontab; use app\model\GetLodeLog; /** * 定时删除获取验证码暂存表 */ class Task5 { public function onWorkerStart() { // 每1秒执行一次 收取验证码 new Crontab('*/1 * * * * *', function () { $GetLodeLog = GetLodeLog::where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 minutes')))->delete(); }); } }