where("is_del=0 and status>=1 and expiretime<='".date("Y-m-d H:i:s")."'")->select(); foreach ($acocunt as $value){ Db::name("Account")->where($value)->update(['status'=>2,"updatetime"=>date("Y-m-d H:i:s")]); } } }