From 851af782592eb11d0fbd7a1e187625f23f09791f Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 11 Mar 2022 09:22:08 +0000 Subject: [PATCH] =?UTF-8?q?update=20application/api/controller/User.php.?= =?UTF-8?q?=201.=E6=96=B0=E5=A2=9E=E4=BA=86=E7=94=9F=E6=97=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=202.=E6=96=B0=E5=A2=9E=E4=BA=86=E6=80=A7=E5=88=AB?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=203.=E4=BC=98=E5=8C=96=E4=BA=86=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E4=B8=BA=E7=A9=BA=E4=BF=9D=E6=8C=81=E4=B8=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/User.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 762d2e5d8..9f18630b2 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -157,6 +157,8 @@ class User extends Api * @param string $username 用户名 * @param string $nickname 昵称 * @param string $bio 个人简介 + * @param string $birthday 生日 + * @param string $gender 性别 */ public function profile() { @@ -164,6 +166,8 @@ class User extends Api $username = $this->request->post('username'); $nickname = $this->request->post('nickname'); $bio = $this->request->post('bio'); + $birthday = $this->request->post('birthday'); + $gender = $this->request->post('gender'); $avatar = $this->request->post('avatar', '', 'trim,strip_tags,htmlspecialchars'); if ($username) { $exists = \app\common\model\User::where('username', $username)->where('id', '<>', $this->auth->id)->find(); @@ -180,7 +184,9 @@ class User extends Api $user->nickname = $nickname; } $user->bio = $bio; - $user->avatar = $avatar; + if ($avatar) $user->avatar = $avatar; + if ($birthday) $user->birthday = $birthday; + if ($gender) $user->gender = $gender; $user->save(); $this->success(); } -- Gitee