diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d195401..2046d530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +### [v1.6.0](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.0)(2022-10-26) + +- 播放器中间增加大号播放按钮 +- 单页和帮助增加浏览计数属性 +- logo上增加首页链接 +- 修正分类默认图标问题 +- 修正layui-main样式更新带来的问题 +- 更新composer包 +- 调整退款手续费范围 +- 导航部分,教师->师资 +- 优化分页组件参数 +- 优化内容表格样式 +- 优化热门问题和热门答主 +- 优化通知计数方式 + ### [v1.5.9](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.9)(2022-09-20) - 修正内容图片上传问题 diff --git a/README.md b/README.md index ad3255db..05d3b71d 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,6 @@ H5手机端演示: Tips: 测试支付请用手机号注册一个新账户,以便接收订单通知,以及避免课程无法购买 -即时通讯演示: - -请使用以下两个账号在不同终端或者浏览器登录,打开微聊界面 - -- 帐号A:100015@163.com / 123456 -- 帐号B:100065@163.com / 123456 - 微信推送演示: Tips: 请用手机注册一个新账号,用户中心 -> 关注订阅,扫码关注公众号。之后的登录、购买、退款、直播、咨询等会有消息推送。 diff --git a/app/Caches/HotQuestionList.php b/app/Caches/HotQuestionList.php index dea5c8a4..f557a688 100644 --- a/app/Caches/HotQuestionList.php +++ b/app/Caches/HotQuestionList.php @@ -48,6 +48,12 @@ class HotQuestionList extends Cache return $this->handleQuestions($questions); } + $questions = $this->findFullyHotQuestions(); + + if ($questions->count() > 0) { + return $this->handleQuestions($questions); + } + return []; } @@ -102,6 +108,17 @@ class HotQuestionList extends Cache return $this->findHotQuestions($createTime, $limit); } + /** + * @param int $limit + * @return ResultsetInterface|Resultset|QuestionModel[] + */ + protected function findFullyHotQuestions($limit = 10) + { + $createTime = 0; + + return $this->findHotQuestions($createTime, $limit); + } + /** * @param int $createTime * @param int $limit diff --git a/app/Caches/TopAnswererList.php b/app/Caches/TopAnswererList.php index aa2f5225..fe881f5d 100644 --- a/app/Caches/TopAnswererList.php +++ b/app/Caches/TopAnswererList.php @@ -7,8 +7,8 @@ namespace App\Caches; -use App\Models\Article as ArticleModel; -use App\Models\ArticleLike as ArticleLikeModel; +use App\Models\Answer as AnswerModel; +use App\Models\AnswerLike as AnswerLikeModel; use App\Repos\User as UserRepo; use Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\ResultsetInterface; @@ -37,10 +37,24 @@ class TopAnswererList extends Cache return $this->handleUsers($userIds); } - $randOwners = $this->findRandArticleOwners(); + $rankings = $this->findMonthlyAuthorRankings(); - if ($randOwners->count() > 0) { - $userIds = kg_array_column($randOwners->toArray(), 'owner_id'); + if ($rankings->count() > 0) { + $userIds = kg_array_column($rankings->toArray(), 'author_id'); + return $this->handleUsers($userIds); + } + + $rankings = $this->findYearlyAuthorRankings(); + + if ($rankings->count() > 0) { + $userIds = kg_array_column($rankings->toArray(), 'author_id'); + return $this->handleUsers($userIds); + } + + $rankings = $this->findFullyAuthorRankings(); + + if ($rankings->count() > 0) { + $userIds = kg_array_column($rankings->toArray(), 'author_id'); return $this->handleUsers($userIds); } @@ -73,23 +87,53 @@ class TopAnswererList extends Cache * @param int $limit * @return ResultsetInterface|Resultset */ - protected function findRandArticleOwners($limit = 10) + protected function findWeeklyAuthorRankings($limit = 10) { - return ArticleModel::query() - ->columns(['owner_id']) - ->orderBy('RAND()') - ->limit($limit) - ->execute(); + $createTime = strtotime('monday this week'); + + return $this->findAuthorRankings($createTime, $limit); } /** * @param int $limit * @return ResultsetInterface|Resultset */ - protected function findWeeklyAuthorRankings($limit = 10) + protected function findMonthlyAuthorRankings($limit = 10) { - $createTime = strtotime('monday this week'); + $createTime = strtotime(date('Y-m-01')); + return $this->findAuthorRankings($createTime, $limit); + } + + /** + * @param int $limit + * @return ResultsetInterface|Resultset + */ + protected function findYearlyAuthorRankings($limit = 10) + { + $createTime = strtotime(date('Y-01-01')); + + return $this->findAuthorRankings($createTime, $limit); + } + + /** + * @param int $limit + * @return ResultsetInterface|Resultset + */ + protected function findFullyAuthorRankings($limit = 10) + { + $createTime = 0; + + return $this->findAuthorRankings($createTime, $limit); + } + + /** + * @param int $createTime + * @param int $limit + * @return ResultsetInterface|Resultset + */ + protected function findAuthorRankings($createTime, $limit = 10) + { $columns = [ 'author_id' => 'a.owner_id', 'like_count' => 'count(al.user_id)', @@ -97,8 +141,8 @@ class TopAnswererList extends Cache return $this->modelsManager->createBuilder() ->columns($columns) - ->addFrom(ArticleLikeModel::class, 'al') - ->join(ArticleModel::class, 'al.article_id = a.id', 'a') + ->addFrom(AnswerLikeModel::class, 'al') + ->join(AnswerModel::class, 'al.answer_id = a.id', 'a') ->where('al.create_time > :create_time:', ['create_time' => $createTime]) ->groupBy('author_id') ->orderBy('like_count DESC') diff --git a/app/Console/Tasks/SyncAppInfoTask.php b/app/Console/Tasks/SyncAppInfoTask.php index 7e118ed9..cbca2b44 100644 --- a/app/Console/Tasks/SyncAppInfoTask.php +++ b/app/Console/Tasks/SyncAppInfoTask.php @@ -15,7 +15,7 @@ class SyncAppInfoTask extends Task public function mainAction() { - $url = 'https://koogua.com/api/instance/collect'; + $url = 'https://www.koogua.com/api/instance/collect'; $site = $this->getSettings('site'); diff --git a/app/Http/Admin/Views/help/list.volt b/app/Http/Admin/Views/help/list.volt index 34b3aa4f..6f1af71c 100644 --- a/app/Http/Admin/Views/help/list.volt +++ b/app/Http/Admin/Views/help/list.volt @@ -22,6 +22,7 @@