GroupApi.php 498 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Http\Api;
  3. use App\Models\GroupInfo;
  4. class GroupApi
  5. {
  6. public static function getById($id)
  7. {
  8. $group = GroupInfo::where("uid", $id)->first();
  9. if ($group) {
  10. return [
  11. 'id' => $id,
  12. 'name' => $group->name,
  13. 'realName' => $group->uid,
  14. 'studioName' => $group->name,
  15. 'nickName' => $group->name,
  16. ];
  17. } else {
  18. return null;
  19. }
  20. }
  21. }