dever пре 3 година
родитељ
комит
5586dbd02a
1 измењених фајлова са 3 додато и 3 уклоњено
  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';