|
@@ -105,7 +105,7 @@ class Api
|
|
|
*
|
|
|
* @return mixed
|
|
|
*/
|
|
|
- public function string($area)
|
|
|
+ public function string($area, $im = ',')
|
|
|
{
|
|
|
if ($area) {
|
|
|
$area = explode(',', $area);
|
|
@@ -115,11 +115,14 @@ class Api
|
|
|
$result[$k] = $this->getName('province', $v);
|
|
|
} elseif ($k == 1) {
|
|
|
$result[$k] = $this->getName('city', $v);
|
|
|
+ if ($result[0]['name'] == $result[1]['name']) {
|
|
|
+ unset($result[1]);
|
|
|
+ }
|
|
|
} elseif ($k == 2) {
|
|
|
$result[$k] = $this->getName('county', $v);
|
|
|
}
|
|
|
}
|
|
|
- return implode(',', $result);
|
|
|
+ return implode($im, $result);
|
|
|
}
|
|
|
return '';
|
|
|
}
|