def getCityXiaoqu(sql=''): ms = GJDB() ms.ms() ms.selectDB('xiaoqu') ms.executeDB('SET NAMES UTF8;') if sql == '': sql = 'SELECT distinct city, name FROM xiaoqu_xiaoqu;' return ms.selectData(sql)
def getCityDistrictStreet(sql=''): management = GJDB() management.management() management.selectDB('management') management.executeDB('SET NAMES UTF8;') if sql == '': sql = 'SELECT city.short_name city_name, city.domain, district.short_name district_name,district.url, street.street_name, street.url FROM street INNER JOIN district INNER JOIN city ON district.district_id=street.district_id AND city.city_id=district.city_id;' return management.selectData(sql)