visuddhinanda 1 год назад
Родитель
Сommit
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;
         }
     }
-
 }