...
|
...
|
@@ -124,17 +124,21 @@ class User extends Api |
|
|
}
|
|
|
}
|
|
|
$data = Db::name('user')->where('id',$user_id)->find();
|
|
|
if(empty($data['image'])){
|
|
|
Db::name('user')
|
|
|
->where('id',$user_id)
|
|
|
->update(['nickname'=>$nickname,'sex'=>$sex,'card'=>$card,'work_address'=>$work_address,'phone'=>$phone,'image'=>$image]);
|
|
|
}else{
|
|
|
$params = [];
|
|
|
if($sex){
|
|
|
$params['sex'] = $sex;
|
|
|
}
|
|
|
if($phone){
|
|
|
$params['phone'] = $phone;
|
|
|
}
|
|
|
if(empty($data['image']) && $image){
|
|
|
$params['image'] = $image;
|
|
|
}
|
|
|
if($params){
|
|
|
Db::name('user')
|
|
|
->where('id',$user_id)
|
|
|
->update(['nickname'=>$nickname,'sex'=>$sex,'card'=>$card,'work_address'=>$work_address,'phone'=>$phone]);
|
|
|
->update($params);
|
|
|
}
|
|
|
|
|
|
|
|
|
$this->success('success');
|
|
|
}
|
|
|
|
...
|
...
|
|