瀏覽代碼

更新 'lib/Manage.php'

rabin 3 年之前
父節點
當前提交
f8ccde9e14
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      lib/Manage.php

+ 9 - 0
lib/Manage.php

@@ -192,6 +192,9 @@ class Manage
             foreach ($data as $k => $v) {
                 if (is_array($v)) {
                     $province = Dever::db('area/province')->find($v['province_id']);
+                  if (!$province) {
+                    	$province['name'] = '';
+                  	}
                     $v['name'] = $province['name'] . '' . $v['name'];
                     if ($v['price'] < 0) {
                         $price = Dever::load('area/api')->getPrice(1, $v['province_id'] . ',' . $v['id']);
@@ -224,6 +227,12 @@ class Manage
                 if (is_array($v)) {
                     $province = Dever::db('area/province')->find($v['province_id']);
                     $city = Dever::db('area/city')->find($v['city_id']);
+                  if (!$province) {
+                    	$province['name'] = '';
+                  	}
+                  if (!$city) {
+                    	$city['name'] = '';
+                  	}
                     $v['name'] = $province['name'] . '' . $city['name'] . '' . $v['name'];
                     if ($v['price'] < 0) {
                         $price = Dever::load('area/api')->getPrice(2, $v['province_id'] . ',' . $v['city_id'] . ',' . $v['id']);