The House approved a compromise funding bill and sent it to President Trump to sign, ending the second government shutdown in three weeks.