static function listdata($province_id=null,$limit=50,$order='id asc',$where2=null) { if ($province_id) $where='parentid='.$province_id; else $where='parentid=0'; if(preg_match("/find_in_set\((\w+),'(.+?)'\)/",$order,$match)) if(empty($where2)) $where2="$match[1] in ($match[2])"; if ($where2) $where.=' and '.str_replace ('-',' ',$where2); $area=new area; $areas=$area->getrows($where,$limit,str_replace ('-',' ',$order)); foreach ($areas as $order=>$area) { if ($province_id) $area['url']=self::city_url($area['id']); else $area['url']=self::province_url($area['id']); if(strlen($area['name'])==12 ||strlen($area['name'])==18) $area['shortname']=cut($area['name'],3); else $area['shortname']=cut($area['name'],2); $areas[$order]=$area; } return $areas; }