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

测试

@@ -89,14 +89,7 @@ class UserAddress extends Model @@ -89,14 +89,7 @@ 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 - $isdefault = $data['isdefault'];  
93 - return $this->allowField(true)  
94 - ->save(array_merge(compact(  
95 - 'province_id',  
96 - 'city_id',  
97 - 'district_id',  
98 - 'isdefault'  
99 - ), $data)); 92 + return $this->save(array_merge(compact('province_id', 'city_id', 'district_id'), $data));
100 } 93 }
101 94
102 /** 95 /**
@@ -85,9 +85,7 @@ class UserSize extends Model @@ -85,9 +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(array_merge([  
89 - 'isdefault' => $data['isdefault']  
90 - ],$data)); 88 + return $this->save($data);
91 } 89 }
92 90
93 /** 91 /**