浏览代码

输出realName

visuddhinanda 1 年之前
父节点
当前提交
ac6aa95ac6
共有 1 个文件被更改,包括 16 次插入10 次删除
  1. 16 10
      api-v8/app/Http/Api/GroupApi.php

+ 16 - 10
api-v8/app/Http/Api/GroupApi.php

@@ -1,18 +1,24 @@
 <?php
+
 namespace App\Http\Api;
+
 use App\Models\GroupInfo;
 
-class GroupApi{
-    public static function getById($id){
-        $group = GroupInfo::where("uid",$id)->first();
-        if($group){
+class GroupApi
+{
+    public static function getById($id)
+    {
+        $group = GroupInfo::where("uid", $id)->first();
+        if ($group) {
             return [
-                    'id'=>$id,
-                    'name'=>$group->name,
-                ];
-        }else{
-            return false;
+                'id' => $id,
+                'name' => $group->name,
+                'realName' => $group->uid,
+                'studioName' => $group->name,
+                'nickName' => $group->name,
+            ];
+        } else {
+            return null;
         }
     }
-
 }