|
@@ -410,12 +410,14 @@ class Member extends Api
|
|
|
* @ApiParams (name="token", type="int", required=true, description="请求的Token")
|
|
|
* @ApiParams (name="nickname", type="string", required=true, description="昵称")
|
|
|
* @ApiParams (name="avatar", type="string", required=true, description="头像地址")
|
|
|
+ * @ApiParams (name="sex", type="string", required=true, description="未知,男,女")
|
|
|
* @ApiReturn ()
|
|
|
*/
|
|
|
public function my_edit(){
|
|
|
$userId = $this->request->post('user_id');
|
|
|
$nickname= $this->request->post('nickname');
|
|
|
$avatar = $this->request->post('avatar');
|
|
|
+ $sex = $this->request->post('sex');
|
|
|
if (empty($userId)){
|
|
|
$this->result('登录信息丢失');
|
|
|
}
|
|
@@ -426,6 +428,11 @@ class Member extends Api
|
|
|
if (!empty($avatar)){
|
|
|
$update['avatar']=$avatar;
|
|
|
}
|
|
|
+ if (!empty($sex)){
|
|
|
+ $update['sex']=$sex;
|
|
|
+ }else{
|
|
|
+ $update['sex']='未知';
|
|
|
+ }
|
|
|
if (!empty($update)){
|
|
|
MemberModel::where(['id'=>$userId])->update($update);
|
|
|
$this->result('信息修改成功', [], 1);
|