diff --git a/app/Console/Tasks/ArticleIndexTask.php b/app/Console/Tasks/ArticleIndexTask.php index 017a2577..0779ca27 100644 --- a/app/Console/Tasks/ArticleIndexTask.php +++ b/app/Console/Tasks/ArticleIndexTask.php @@ -20,8 +20,6 @@ class ArticleIndexTask extends Task * 搜索测试 * * @command: php console.php article_index search {query} - * @param array $params - * @throws \XSException */ public function searchAction($params) { @@ -31,7 +29,9 @@ class ArticleIndexTask extends Task exit('please special a query word' . PHP_EOL); } - $result = $this->searchArticles($query); + $handler = new ArticleSearcher(); + + $result = $handler->search($query); var_export($result); } @@ -42,24 +42,6 @@ class ArticleIndexTask extends Task * @command: php console.php article_index clean */ public function cleanAction() - { - $this->cleanArticleIndex(); - } - - /** - * 重建索引 - * - * @command: php console.php article_index rebuild - */ - public function rebuildAction() - { - $this->rebuildArticleIndex(); - } - - /** - * 清空索引 - */ - protected function cleanArticleIndex() { $handler = new ArticleSearcher(); @@ -74,8 +56,10 @@ class ArticleIndexTask extends Task /** * 重建索引 + * + * @command: php console.php article_index rebuild */ - protected function rebuildArticleIndex() + public function rebuildAction() { $articles = $this->findArticles(); @@ -83,7 +67,7 @@ class ArticleIndexTask extends Task $handler = new ArticleSearcher(); - $documenter = new ArticleDocument(); + $doc = new ArticleDocument(); $index = $handler->getXS()->getIndex(); @@ -92,7 +76,7 @@ class ArticleIndexTask extends Task $index->beginRebuild(); foreach ($articles as $article) { - $document = $documenter->setDocument($article); + $document = $doc->setDocument($article); $index->add($document); } @@ -102,17 +86,39 @@ class ArticleIndexTask extends Task } /** - * 搜索文章 + * 刷新索引缓存 * - * @param string $query - * @return array - * @throws \XSException + * @command: php console.php article_index flush_index */ - protected function searchArticles($query) + public function flushIndexAction() { $handler = new ArticleSearcher(); - return $handler->search($query); + $index = $handler->getXS()->getIndex(); + + echo '------ start flush article index ------' . PHP_EOL; + + $index->flushIndex(); + + echo '------ end flush article index ------' . PHP_EOL; + } + + /** + * 刷新搜索日志 + * + * @command: php console.php article_index flush_logging + */ + public function flushLoggingAction() + { + $handler = new ArticleSearcher(); + + $index = $handler->getXS()->getIndex(); + + echo '------ start flush article logging ------' . PHP_EOL; + + $index->flushLogging(); + + echo '------ end flush article logging ------' . PHP_EOL; } /** diff --git a/app/Console/Tasks/CourseIndexTask.php b/app/Console/Tasks/CourseIndexTask.php index ed568faf..6bd06246 100644 --- a/app/Console/Tasks/CourseIndexTask.php +++ b/app/Console/Tasks/CourseIndexTask.php @@ -20,8 +20,6 @@ class CourseIndexTask extends Task * 搜索测试 * * @command: php console.php course_index search {query} - * @param array $params - * @throws \XSException */ public function searchAction($params) { @@ -31,7 +29,9 @@ class CourseIndexTask extends Task exit('please special a query word' . PHP_EOL); } - $result = $this->searchCourses($query); + $handler = new CourseSearcher(); + + $result = $handler->search($query); var_export($result); } @@ -42,24 +42,6 @@ class CourseIndexTask extends Task * @command: php console.php course_index clean */ public function cleanAction() - { - $this->cleanCourseIndex(); - } - - /** - * 重建索引 - * - * @command: php console.php course_index rebuild - */ - public function rebuildAction() - { - $this->rebuildCourseIndex(); - } - - /** - * 清空索引 - */ - protected function cleanCourseIndex() { $handler = new CourseSearcher(); @@ -74,8 +56,10 @@ class CourseIndexTask extends Task /** * 重建索引 + * + * @command: php console.php course_index rebuild */ - protected function rebuildCourseIndex() + public function rebuildAction() { $courses = $this->findCourses(); @@ -83,7 +67,7 @@ class CourseIndexTask extends Task $handler = new CourseSearcher(); - $documenter = new CourseDocument(); + $doc = new CourseDocument(); $index = $handler->getXS()->getIndex(); @@ -92,7 +76,7 @@ class CourseIndexTask extends Task $index->beginRebuild(); foreach ($courses as $course) { - $document = $documenter->setDocument($course); + $document = $doc->setDocument($course); $index->add($document); } @@ -102,17 +86,39 @@ class CourseIndexTask extends Task } /** - * 搜索课程 + * 刷新索引缓存 * - * @param string $query - * @return array - * @throws \XSException + * @command: php console.php course_index flush_index */ - protected function searchCourses($query) + public function flushIndexAction() { $handler = new CourseSearcher(); - return $handler->search($query); + $index = $handler->getXS()->getIndex(); + + echo '------ start flush course index ------' . PHP_EOL; + + $index->flushIndex(); + + echo '------ end flush course index ------' . PHP_EOL; + } + + /** + * 刷新搜索日志 + * + * @command: php console.php course_index flush_logging + */ + public function flushLoggingAction() + { + $handler = new CourseSearcher(); + + $index = $handler->getXS()->getIndex(); + + echo '------ start flush course logging ------' . PHP_EOL; + + $index->flushLogging(); + + echo '------ end flush course logging ------' . PHP_EOL; } /** @@ -124,7 +130,7 @@ class CourseIndexTask extends Task { return CourseModel::query() ->where('published = 1') - ->where('deleted = 0') + ->andWhere('deleted = 0') ->execute(); } diff --git a/app/Console/Tasks/QuestionIndexTask.php b/app/Console/Tasks/QuestionIndexTask.php index 886d0aea..d06c1391 100644 --- a/app/Console/Tasks/QuestionIndexTask.php +++ b/app/Console/Tasks/QuestionIndexTask.php @@ -20,8 +20,6 @@ class QuestionIndexTask extends Task * 搜索测试 * * @command: php console.php question_index search {query} - * @param array $params - * @throws \XSException */ public function searchAction($params) { @@ -31,7 +29,9 @@ class QuestionIndexTask extends Task exit('please special a query word' . PHP_EOL); } - $result = $this->searchQuestions($query); + $handler = new QuestionSearcher(); + + $result = $handler->search($query); var_export($result); } @@ -42,24 +42,6 @@ class QuestionIndexTask extends Task * @command: php console.php question_index clean */ public function cleanAction() - { - $this->cleanQuestionIndex(); - } - - /** - * 重建索引 - * - * @command: php console.php question_index rebuild - */ - public function rebuildAction() - { - $this->rebuildQuestionIndex(); - } - - /** - * 清空索引 - */ - protected function cleanQuestionIndex() { $handler = new QuestionSearcher(); @@ -74,8 +56,10 @@ class QuestionIndexTask extends Task /** * 重建索引 + * + * @command: php console.php question_index rebuild */ - protected function rebuildQuestionIndex() + public function rebuildAction() { $questions = $this->findQuestions(); @@ -83,7 +67,7 @@ class QuestionIndexTask extends Task $handler = new QuestionSearcher(); - $documenter = new QuestionDocument(); + $doc = new QuestionDocument(); $index = $handler->getXS()->getIndex(); @@ -92,7 +76,7 @@ class QuestionIndexTask extends Task $index->beginRebuild(); foreach ($questions as $question) { - $document = $documenter->setDocument($question); + $document = $doc->setDocument($question); $index->add($document); } @@ -102,17 +86,39 @@ class QuestionIndexTask extends Task } /** - * 搜索文章 + * 刷新索引缓存 * - * @param string $query - * @return array - * @throws \XSException + * @command: php console.php question_index flush_index */ - protected function searchQuestions($query) + public function flushIndexAction() { $handler = new QuestionSearcher(); - return $handler->search($query); + $index = $handler->getXS()->getIndex(); + + echo '------ start flush question index ------' . PHP_EOL; + + $index->flushIndex(); + + echo '------ end flush question index ------' . PHP_EOL; + } + + /** + * 刷新搜索日志 + * + * @command: php console.php question_index flush_logging + */ + public function flushLoggingAction() + { + $handler = new QuestionSearcher(); + + $index = $handler->getXS()->getIndex(); + + echo '------ start flush question logging ------' . PHP_EOL; + + $index->flushLogging(); + + echo '------ end flush question logging ------' . PHP_EOL; } /** diff --git a/app/Http/Home/Views/vip/index.volt b/app/Http/Home/Views/vip/index.volt index e7fe11d7..a6fb5dba 100644 --- a/app/Http/Home/Views/vip/index.volt +++ b/app/Http/Home/Views/vip/index.volt @@ -4,13 +4,13 @@
会员权益
-
- 好课畅学 - 会员折扣 - 高清视频 - 广告免疫 - 会员标识 - 贴心服务 +
+ + + + + +
开通会员
@@ -57,4 +57,4 @@ {{ js_include('home/js/vip.index.js') }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css index 66155a73..09b01224 100644 --- a/public/static/home/css/common.css +++ b/public/static/home/css/common.css @@ -1292,6 +1292,14 @@ margin-right: 10px; } +.sidebar-course-card .meta .price { + color: red; +} + +.sidebar-course-card .meta .free { + color: green; +} + .sidebar-chapter-list { height: 405px; overflow-y: auto; @@ -1457,20 +1465,12 @@ margin-bottom: 30px; } -.vip-reason-list { +.vip-priv-list { padding: 30px; margin-bottom: 30px; text-align: center; } -.vip-reason-list .reason-badge { - height: 30px; - line-height: 30px; - padding: 0 10px; - margin-right: 15px; - background-color: #1E9FFF; -} - .vip-option-list { margin-bottom: 30px; } @@ -1925,7 +1925,7 @@ .my-profile-card .vip { position: absolute; right: 15px; - top:15px; + top: 15px; } .my-profile-card .avatar {