Jonlin преди 6 години
родител
ревизия
815c8bce5b
променени са 1 файла, в които са добавени 19 реда и са изтрити 0 реда
  1. 19 0
      application/service/controller/Services.php

+ 19 - 0
application/service/controller/Services.php

@@ -71,6 +71,25 @@ class Services extends Base
         }
     }
 
+    //获取用户信息
+    public function accountInfo()
+    {
+        if(request()->isPost()) {
+            $account_id = input("param.account_id/s");
+
+            $account = db('accounts')->field('id,account_name,nick_name,account_email,account_phone,address,remark,label_id')->where('id', $account_id)->find();
+            if(empty($account)){
+                return json(['code' => -1, 'data' => '', 'msg' => '用户不存在']);
+            }
+
+            $label = db('accountslabel')->where('id', $account['label_id'])->find();
+            if(!empty($label)){
+                $account['label'] = $label['name'];
+            }
+            return json(['code' => 1, 'data' => $account, 'msg' => '成功']);
+        }
+    }
+
     // 客服信息修改
     public function updateinfo()
     {