In California the district attorney prosecuties felonies and misdemenors, but the city attorney prosecuties misdemenors, such as municipal code violations. The district attorney can send you to prison, but the most a city attorney can do is ask that you spend time in the county jail for up to a year.
There could be several reasons the district attorney told the city attorney to take over the case. For example, the offense is a misdemeanor or the violation(s) pertains to municipal ordinance violations. But in any event the district attorney probably did not think the offense was that serious. Also, the city attorney in many places in California has an informal conference where you can resolve your differences with another party and avoid any criminal prosecution. For example, if another person is involved, the case could be dismissed by way of a "civil compromise."
I hope this information is helpful to you.