ZxcZxc123 2 rokov pred
rodič
commit
b64c22d96a
1 zmenil súbory, kde vykonal 2 pridanie a 7 odobranie
  1. 2 7
      app/api/controller/Education.php

+ 2 - 7
app/api/controller/Education.php

@@ -132,7 +132,7 @@ class Education
      */
     public function getCourseInfo($gr_id) {
         $courses = EducationCourse::where('course_status', 1)
-            ->where('gr_id', $gr_id)
+            ->whereIn('gr_id', (array) $gr_id)
             ->where('course_audit', 1)
             ->select();
         $course_list = [];
@@ -145,12 +145,7 @@ class Education
             ];
             $course_list[] = $course_info;
         }
-        $count_and_all = [];
-        if (is_array($gr_id)) {
-            $count_and_all = $this->getCountAndAlll($gr_id);
-        } else {
-            $count_and_all = $this->getCountAndAlll([$gr_id]);
-        }
+        $count_and_all = $this->getCountAndAlll((array) $gr_id);
         $result = [
             'course_list' => $course_list,
             'count' => $count_and_all[0]['count'],