ZxcZxc123 2 years ago
parent
commit
3c695eff57
1 changed files with 3 additions and 5 deletions
  1. 3 5
      app/api/controller/Education.php

+ 3 - 5
app/api/controller/Education.php

@@ -131,10 +131,11 @@ class Education
      * @throws \think\db\exception\ModelNotFoundException
      */
     public function getCourseInfo($gr_id) {
-        $courses = EducationCourse::where('course_status', 1)
+        $courses = DB::table('education_courses')
+            ->where('course_status', 1)
             ->whereIn('gr_id', (array) $gr_id)
             ->where('course_audit', 1)
-            ->select();
+            ->get();
         $course_list = [];
         foreach ($courses as $course) {
             $course_info = [
@@ -145,9 +146,6 @@ class Education
             ];
             $course_list[] = $course_info;
         }
-        if (!is_array($gr_id)) {
-            $gr_id = [$gr_id];
-        }
         $count_and_all = $this->getCountAndAlll($gr_id);
         $result = [
             'course_list' => $course_list,