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

测试

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