Explorar el Código

修改客户信息

shish hace 3 años
padre
commit
bdc69b6976
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      app-mall/controllers/UserController.php

+ 7 - 0
app-mall/controllers/UserController.php

@@ -20,11 +20,18 @@ class UserController extends BaseController
     //修改信息 ssh 20221015
     //修改信息 ssh 20221015
     public function actionUpdate()
     public function actionUpdate()
     {
     {
+        $post = Yii::$app->request->post();
         $user = $this->user;
         $user = $this->user;
         if (empty($user)) {
         if (empty($user)) {
             util::fail('请先登录');
             util::fail('请先登录');
         }
         }
         $userId = $user->id ?? 0;
         $userId = $user->id ?? 0;
+        $address = $post['address'] ?? '';
+        $floor = $post['floor'] ?? '';
+        $fullAddress = $address . $floor;
+        $post['fullAddress'] = $fullAddress;
+        UserClass::updateById($userId, $post);
+        util::complete();
     }
     }
 
 
     //获取当前登录用户的信息 ssh 20221014
     //获取当前登录用户的信息 ssh 20221014