浏览代码

'性别修改'

aiyou 4 年之前
父节点
当前提交
a6e49ff545
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      application/api/controller/Member.php

+ 7 - 0
application/api/controller/Member.php

@@ -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);