onWorkerStart=function (WO $worker){ Timer::add(3,function (){ $ids=Mobile::where('activity_time_end','<=',time()) ->where('is_activity',1) ->where('type',1) ->column('id'); self::log("找到".count($ids).'条记录'); foreach ($ids as $id){ $mobile=Mobile::find($id); $mobile->makeNotActivity(); } }); }; } } //MobileActivity::run();