Kaynağa Gözat

用户列表

rkljw 11 saat önce
ebeveyn
işleme
681581548e

+ 19 - 3
app/JsonRpc/UserService.php

@@ -357,7 +357,7 @@ class UserService implements UserServiceInterface
      */
     public function updateUserInfo(array $data): array
     {
-        return 1;
+        return [];
     }
 
     /**
@@ -388,8 +388,8 @@ class UserService implements UserServiceInterface
     {
         Db::beginTransaction();
         try {
-            User::where(['id' => $id])->delete();
-            UserInfo::where(['user_id' => $id])->delete();
+//            User::where(['id' => $id])->delete();
+//            UserInfo::where(['user_id' => $id])->delete();
             Db::commit();
         } catch (\Throwable $ex) {
             Db::rollBack();
@@ -640,4 +640,20 @@ class UserService implements UserServiceInterface
             return Result::error('查询失败');
         }
     }
+    /**
+     * 根据类型获取用户列表
+     */
+    public function getTypeUserList(array $data): array
+    {
+        $result = User::when($data, function ($query) use ($data) {
+            if (isset($data['type_id']) && $data['type_id']) {
+                $query->where('type_id', $data['type_id']);
+            }
+        })->where('status', 1)->get();
+        if ($result) {
+            return Result::success($result);
+        } else {
+            return Result::error('查询失败');
+        }
+    }
 }

+ 6 - 0
app/JsonRpc/UserServiceInterface.php

@@ -125,5 +125,11 @@ interface UserServiceInterface
      * @return array
      */
     public function getWebsiteGroupInfo(array $data): array;
+    /**
+     * 根据类型获取用户列表
+     * @param array $data
+     * @return array
+     */
+    public function getTypeUserList(array $data): array;
 
 }