dever %!s(int64=3) %!d(string=hai) anos
pai
achega
5586dbd02a
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/Api.php

+ 3 - 3
src/Api.php

@@ -174,15 +174,15 @@ class Api
         $update['status'] = $status;
         $temp = explode(',', $area);
         $num = count($temp);
-        if ($num == 4) {
+        if ($num == 4 && isset($temp[3]) && $temp[3]) {
             # 街道
             $update['where_id'] = $temp[3];
             $table = 'area/town';
-        } elseif ($num == 3) {
+        } elseif ($num == 3 && isset($temp[2]) && $temp[2]) {
             # 区县
             $update['where_id'] = $temp[2];
             $table = 'area/county';
-        } elseif ($num == 2) {
+        } elseif ($num == 2 && isset($temp[1]) && $temp[1]) {
             # 城市
             $update['where_id'] = $temp[1];
             $table = 'area/city';