GroupApi.php 362 B

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