|
@@ -88,11 +88,15 @@ class UserAddress extends Model |
|
@@ -88,11 +88,15 @@ class UserAddress extends Model |
88
|
// 该地址设为默认,其他地址就设为非默认
|
88
|
// 该地址设为默认,其他地址就设为非默认
|
89
|
if($data['isdefault'] == '1'){
|
89
|
if($data['isdefault'] == '1'){
|
90
|
self::where('user_id',$this['user_id'])->update(['isdefault'=>'0']);
|
90
|
self::where('user_id',$this['user_id'])->update(['isdefault'=>'0']);
|
91
|
- $data['isdefault'] = 1;
|
|
|
92
|
}
|
91
|
}
|
|
|
92
|
+ $isdefault = $data['isdefault'];
|
93
|
return $this->allowField(true)
|
93
|
return $this->allowField(true)
|
94
|
- ->isUpdate(true)
|
|
|
95
|
- ->save(array_merge(compact('province_id', 'city_id', 'district_id'), $data));
|
94
|
+ ->save(array_merge(compact(
|
|
|
95
|
+ 'province_id',
|
|
|
96
|
+ 'city_id',
|
|
|
97
|
+ 'district_id',
|
|
|
98
|
+ 'isdefault'
|
|
|
99
|
+ ), $data));
|
96
|
}
|
100
|
}
|
97
|
|
101
|
|
98
|
/**
|
102
|
/**
|