瀏覽代碼

Merge branch 'master' of https://git.bjtdba.com/shop/php

hefei 1 年之前
父節點
當前提交
7aedadbb69
共有 1 個文件被更改,包括 11 次插入8 次删除
  1. 11 8
      app/controller/api/user/User.php

+ 11 - 8
app/controller/api/user/User.php

@@ -1277,14 +1277,17 @@ class User extends BaseController
1277 1277
      * 修改个人信息*/
1278 1278
     public function updateUser()
1279 1279
     {
1280
-        $data = $this->request->params([
1281
-            'nickname',
1282
-            'avatar',
1283
-            'sex',
1284
-            'birthday',
1285
-            'addres',
1286
-            'mark'
1287
-        ]);
1280
+        $data['nickname'] = $this->request->param('nickname', null);
1281
+        $data['avatar'] = $this->request->param('avatar', null);
1282
+        $data['sex'] = $this->request->param('sex', null);
1283
+        $data['birthday'] = $this->request->param('birthday', null);
1284
+        $data['addres'] = $this->request->param('addres', null);
1285
+        $data['mark'] = $this->request->param('mark', null);
1286
+        $data['account'] = $this->request->param('account', null);
1287
+        $data['phone'] = $this->request->param('phone', null);
1288
+        $data = array_filter($data, function($value) {
1289
+            return $value !== null;
1290
+        });
1288 1291
         $uid = $this->request->uid();
1289 1292
         $res = '';
1290 1293
         if ($this->source == 'yhc') {