ZxcZxc123 2 jaren geleden
bovenliggende
commit
87eae4a187
2 gewijzigde bestanden met toevoegingen van 32 en 6 verwijderingen
  1. 0 3
      app/api/route/education.php
  2. 32 3
      app/model/api/Education.php

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

@@ -20,9 +20,6 @@ Route::group('Education', function () {
     Route::rule('recommend','Education/recommend');
     //获取课程详情
     Route::rule('getCourseList','Education/getCourseList');
-
-
-
     //bug提交
     Route::rule('appBugSub', 'Pub/appBugSub');
     //接口测试

+ 32 - 3
app/model/api/Education.php

@@ -8,7 +8,18 @@ class Education extends Model
 {
     protected $table = 'table_education_gr';
 
-    // 获取教育组列表
+
+
+    /**
+     * 获取教育组列表
+     * @param array $where
+     * @param int $limit
+     * @param string $order
+     * @return \think\Collection
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
     public function getEducationGrList($where = [], $limit = 20, $order = 'od asc,recommend desc,gr_id desc')
     {
         $query = $this->where($where)->limit($limit)->order($order);
@@ -22,7 +33,15 @@ class Education extends Model
     }
 
 
-    // 获取课程总数和播放总数
+
+    /**
+     * 获取课程总数和播放量
+     * @param $grId
+     * @return array|int[]|Model
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
     public function getCourseCount($grId)
     {
         $count = $this->table('table_education_course')->where(['gr_id' => $grId, 'course_status' => 1, 'course_audit' => 1])->field('count(*) as count, sum(course_play_count) as alll')->find();
@@ -30,7 +49,17 @@ class Education extends Model
     }
 
 
-    // 获取推荐教育组列表
+
+
+    /**
+     * 获取推荐教育组列表
+     * @param int $limit
+     * @param string $order
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
     public function getRecommendEducationGrList($limit = 9, $order = 'od asc,recommend desc,gr_id desc')
     {
         $recommendList = $this->where(['recommend' => 1])->limit($limit)->order($order)->select();