ZxcZxc123 2 tahun lalu
induk
melakukan
2dd9151686
2 mengubah file dengan 20 tambahan dan 0 penghapusan
  1. 18 0
      app/api/controller/Education.php
  2. 2 0
      app/api/route/education.php

+ 18 - 0
app/api/controller/Education.php

@@ -36,5 +36,23 @@ class Education
     }
 
 
+    /**
+     * 获取轮播列表
+     * @return mixed
+     */
+    public function recommend()
+    {
+        $EducationModel = new \app\model\api\Education();
+        $where = [
+            'audit' => 1,
+            'recommend' => 1,
+        ];
+        $recommendList = $EducationModel->getEducationGrList($where, 9, "od asc,recommend desc,gr_id desc");
+        $result = ['recommendList' => $recommendList];
+
+        return app('json')->success($result);
+    }
+
+
 
 }

+ 2 - 0
app/api/route/education.php

@@ -16,6 +16,8 @@ use think\facade\Route;
 Route::group('Education', function () {
     //课程列表页面
     Route::rule('index','Education/index');
+    //获取轮播列表
+    Route::rule('recommend','Education/recommend');