name='disable never login admin in one month'; $work->onWorkerStart=function (WO $worker){ Timer::add(3,function ()use ($worker){ $userNum=Admin::where('id','>',1) ->where('logintime','<',strtotime('-1month')) ->where('status','normal') ->update(['status'=>'hidden']); $worker::log("禁用了{$userNum}个管理员"); }); }; } } AdminDisable::run();