diff --git a/app/Caches/FeaturedArticleList.php b/app/Caches/FeaturedArticleList.php index 7f1d7640..bdf4d92d 100644 --- a/app/Caches/FeaturedArticleList.php +++ b/app/Caches/FeaturedArticleList.php @@ -39,20 +39,10 @@ class FeaturedArticleList extends Cache $result = []; foreach ($articles as $article) { - - $userCount = $article->user_count; - - if ($article->fake_user_count > $article->user_count) { - $userCount = $article->fake_user_count; - } - $result[] = [ 'id' => $article->id, 'title' => $article->title, 'cover' => $article->cover, - 'market_price' => (float)$article->market_price, - 'vip_price' => (float)$article->vip_price, - 'user_count' => $userCount, 'favorite_count' => $article->favorite_count, 'comment_count' => $article->comment_count, 'view_count' => $article->view_count, @@ -71,7 +61,7 @@ class FeaturedArticleList extends Cache { return ArticleModel::query() ->where('featured = 1') - ->andWhere('published = 1') + ->andWhere('published = :published:', ['published' => ArticleModel::PUBLISH_APPROVED]) ->andWhere('deleted = 0') ->orderBy('RAND()') ->limit($limit) diff --git a/app/Caches/FeaturedQuestionList.php b/app/Caches/FeaturedQuestionList.php index 07ee392c..4508b6ec 100644 --- a/app/Caches/FeaturedQuestionList.php +++ b/app/Caches/FeaturedQuestionList.php @@ -62,7 +62,7 @@ class FeaturedQuestionList extends Cache { return QuestionModel::query() ->where('featured = 1') - ->andWhere('published = 1') + ->andWhere('published = :published:', ['published' => QuestionModel::PUBLISH_APPROVED]) ->andWhere('deleted = 0') ->orderBy('RAND()') ->limit($limit) diff --git a/app/Http/Home/Controllers/CourseController.php b/app/Http/Home/Controllers/CourseController.php index 48a84342..b80acb00 100644 --- a/app/Http/Home/Controllers/CourseController.php +++ b/app/Http/Home/Controllers/CourseController.php @@ -167,10 +167,10 @@ class CourseController extends Controller { $service = new CourseResourceListService(); - $items = $service->handle($id); + $resources = $service->handle($id); $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); - $this->view->setVar('items', $items); + $this->view->setVar('resources', $resources); } /** diff --git a/app/Http/Home/Views/course/recommended.volt b/app/Http/Home/Views/course/recommended.volt deleted file mode 100644 index 7ecdda61..00000000 --- a/app/Http/Home/Views/course/recommended.volt +++ /dev/null @@ -1,12 +0,0 @@ -{{ partial('macros/course') }} - -{% if courses %} -
名称 | -大小 | -操作 | -
---|
{{ item.name }} | -{{ item.size|human_size }} | - {% if item.me.owned == 1 and auth_user.id > 0 %} -下载 | - {% else %} -下载 | - {% endif %} +名称 | +大小 | +操作 |
---|