Except as otherwise provided by law, a city of the first class by ordinance may regulate and prescribe the powers, duties, and compensation of the officers of the city and classify such offices, on the basis of merit as the city council shall provide for that purpose.