| 
					
				 | 
			
			
				@@ -121,7 +121,7 @@ class Api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return mixed 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function string($area, $im = ',', $unset = true, $name = '不限') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function string($area, $im = ',', $unset = true, $name = '不限', $check = false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($area) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (is_string($area)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -138,9 +138,11 @@ class Api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         unset($result[1]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } elseif ($k == 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $result[$k] = $this->getName('county', $v, false, 'id', $name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $parent = $area[0] . ',' . $area[1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $result[$k] = $this->getName('county', $v, false, 'id', $name, $check, $parent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } elseif ($k == 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $result[$k] = $this->getName('town', $v, false, 'id', $name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $parent = $area[0] . ',' . $area[1] . ',' . $area[2]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $result[$k] = $this->getName('town', $v, false, 'id', $name, $check, $parent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } elseif ($k == 4) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $result[$k] = $this->getName('village', $v, false, 'id', $name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -156,7 +158,7 @@ class Api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private function getName($table, $value, $state = false, $col = 'id', $name = '不限') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private function getName($table, $value, $state = false, $col = 'id', $name = '不限', $check = false, $area = array()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (($col == 'id' && $value > 0) || ($col != 'id' && $value)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[$col] = $value; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -166,6 +168,9 @@ class Api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if ($data) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $name = $data['name']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if ($check && $data['area'] != $area) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $name = '<font style="color:red">'.$name.'</font>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $name; 
			 |