|
@@ -181,6 +181,7 @@ class User extends Api
|
|
|
$nickname = input('nickname', '', 'trim'); //昵称
|
|
|
$birthday = input('birthday', '', 'strtotime'); //生日
|
|
|
$hometown_cityid = input('hometown_cityid', '', 'trim'); //城市id
|
|
|
+ $bio = input('bio', '', 'trim'); //个性签名
|
|
|
$hobby = input('hobby', '', 'trim'); //爱好
|
|
|
$marital = input('marital', '', 'trim'); //婚姻
|
|
|
$introcode = input('introcode', '', 'trim'); //邀请码
|
|
@@ -205,6 +206,9 @@ class User extends Api
|
|
|
}
|
|
|
$data['hometown_cityid'] = $hometown_cityid;
|
|
|
}
|
|
|
+ if ($bio) {
|
|
|
+ $data['bio'] = $bio;
|
|
|
+ }
|
|
|
if ($hobby) {
|
|
|
$data['hobby'] = $hobby;
|
|
|
}
|
|
@@ -212,8 +216,6 @@ class User extends Api
|
|
|
$data['marital'] = $marital;
|
|
|
}
|
|
|
if ($introcode && !$this->auth->intro_uid) {
|
|
|
-
|
|
|
-
|
|
|
$intro_user = Db::name('user')->field('id, intro_uid')->where('introcode', $introcode)->find();
|
|
|
if ($intro_user && $intro_user['id'] != $this->auth->id && $intro_user['intro_uid'] != $this->auth->id) {
|
|
|
$data['intro_uid'] = $intro_user['id'];
|
|
@@ -221,11 +223,9 @@ class User extends Api
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//开启事务
|
|
|
Db::startTrans();
|
|
|
- $update_rs = Db::name('user')->where('id',$this->auth->id)->setField($data);
|
|
|
+ $update_rs = Db::name('user')->where('id',$this->auth->id)->update($data);
|
|
|
if($update_rs === false){
|
|
|
Db::rollback();
|
|
|
$this->error('修改失败');
|