浏览代码

:construction:create

visuddhinanda 1 年之前
父节点
当前提交
bf72ac3c75
共有 1 个文件被更改,包括 20 次插入0 次删除
  1. 20 0
      app/Http/Api/CourseApi.php

+ 20 - 0
app/Http/Api/CourseApi.php

@@ -0,0 +1,20 @@
+<?php
+namespace App\Http\Api;
+
+use App\Models\CourseMember;
+use Illuminate\Support\Facades\Log;
+
+class CourseApi{
+    public static function getStudentChannels($courseId){
+        $channels = [];
+        $studentsChannel = CourseMember::where('course_id',$courseId)
+                ->whereNotNull('channel_id')
+                ->select('channel_id')
+                ->orderBy('created_at')
+                ->get();
+        foreach ($studentsChannel as $key => $channel) {
+            $channels[] = $channel->channel_id;
+        }
+        return $channels;
+    }
+}