正在显示
1 个修改的文件
包含
1 行增加
和
0 行删除
@@ -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']; |
-
请 注册 或 登录 后发表评论