作者 耿培杰

修改接口

@@ -21,6 +21,7 @@ class UserAddress extends Model @@ -21,6 +21,7 @@ class UserAddress extends Model
21 $areaExtendModel = new AreaExtend(); 21 $areaExtendModel = new AreaExtend();
22 $where['is_default'] = 1; 22 $where['is_default'] = 1;
23 $data = $this->where($where)->field('createtime,updatetime,is_default,id,user_id',true)->find(); 23 $data = $this->where($where)->field('createtime,updatetime,is_default,id,user_id',true)->find();
  24 + if (!$data) return false;
24 $ids = $data['province_id'] . ',' . $data['city_id'] . ',' . $data['county_id']; 25 $ids = $data['province_id'] . ',' . $data['city_id'] . ',' . $data['county_id'];
25 $area = $areaModel->where(['id' => ['in', $ids]])->column('name'); 26 $area = $areaModel->where(['id' => ['in', $ids]])->column('name');
26 $data['address'] = implode('', $area) . $data['address']; 27 $data['address'] = implode('', $area) . $data['address'];