作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

测试

... ... @@ -89,8 +89,8 @@ class UserAddress extends Model
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), ['id'=>$this['id']]);
return $this->get($this['id'])->allowField(true)
->save(array_merge(compact('province_id', 'city_id', 'district_id'), $data));
}
/**
... ...
... ... @@ -85,7 +85,7 @@ class UserSize extends Model
if(!empty($data['body_info']) && is_array($data['body_info'])){
$data['body_info'] = json_encode($data['body_info']);
}
return $this->allowField(true)->save($data, ['id'=>$this['id']]);
return $this->get($this['id'])->allowField(true)->save($data);
}
/**
... ...