|
|
@@ -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;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|