...
|
...
|
@@ -86,11 +86,11 @@ class UserAddress extends Model |
|
|
$city_id = Area::getIdByName($area[1], 2, $province_id);
|
|
|
$district_id = Area::getIdByName($area[2], 3, $city_id);
|
|
|
// 该地址设为默认,其他地址就设为非默认
|
|
|
// if($data['isdefault'] == '1'){
|
|
|
// self::where('user_id',$this['user_id'])->update(['isdefault'=>'0']);
|
|
|
// }
|
|
|
if($data['isdefault'] == '1'){
|
|
|
self::where('user_id',$this['user_id'])->update(['isdefault'=>'0']);
|
|
|
}
|
|
|
return $this->allowField(true)
|
|
|
->save(array_merge(compact('province_id', 'city_id', 'district_id'), $data));
|
|
|
->save(array_merge(compact('province_id', 'city_id', 'district_id'), $data), ['id'=>$this['id']]);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|