1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-16 23:40:01 +08:00

修正文章和问题缓存

This commit is contained in:
xiaochong0302 2025-03-11 18:48:17 +08:00
parent 77b7224901
commit 90ab9bc018
4 changed files with 2 additions and 38 deletions

View File

@ -1,6 +1,6 @@
## 酷瓜云课堂
![酷瓜云课堂](https://portal-1255691183.file.myqcloud.com/img/content/61dd395c053e5.png)
[![酷瓜云课堂-开源知识付费解决方案](https://portal-1255691183.file.myqcloud.com/img/content/63ec392618bd5.png)](https://www.koogua.com)
### 系统介绍
@ -63,4 +63,4 @@ Tips: 请用手机注册一个新账号,用户中心 -> 关注订阅,扫码
- [码云平台](https://gitee.com/koogua/course-tencent-cloud/issues)
- [官方社区](https://www.koogua.com/community)
- QQ交流群: 788459713
- QQ交流群: 787363898

View File

@ -9,10 +9,8 @@ namespace App\Http\Admin\Services;
use App\Builders\ArticleList as ArticleListBuilder;
use App\Builders\ReportList as ReportListBuilder;
use App\Caches\Article as ArticleCache;
use App\Http\Admin\Services\Traits\AccountSearchTrait;
use App\Library\Paginator\Query as PagerQuery;
use App\Library\Utils\Word as WordUtil;
use App\Models\Article as ArticleModel;
use App\Models\Category as CategoryModel;
use App\Models\Reason as ReasonModel;
@ -137,7 +135,6 @@ class Article extends Service
$article->create();
$this->saveDynamicAttrs($article);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
$this->recountUserArticles($user);
@ -208,7 +205,6 @@ class Article extends Service
$owner = $this->findUser($article->owner_id);
$this->saveDynamicAttrs($article);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
$this->recountUserArticles($owner);
@ -228,7 +224,6 @@ class Article extends Service
$owner = $this->findUser($article->owner_id);
$this->saveDynamicAttrs($article);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
$this->recountUserArticles($owner);
@ -248,7 +243,6 @@ class Article extends Service
$owner = $this->findUser($article->owner_id);
$this->saveDynamicAttrs($article);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
$this->recountUserArticles($owner);
@ -287,7 +281,6 @@ class Article extends Service
$owner = $this->findUser($article->owner_id);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
$this->recountUserArticles($owner);
@ -323,7 +316,6 @@ class Article extends Service
$owner = $this->findUser($article->owner_id);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
$this->recountUserArticles($owner);
}
@ -362,7 +354,6 @@ class Article extends Service
$owner = $this->findUser($article->owner_id);
$this->recountUserArticles($owner);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
}
}
@ -389,7 +380,6 @@ class Article extends Service
$owner = $this->findUser($article->owner_id);
$this->recountUserArticles($owner);
$this->rebuildArticleCache($article);
$this->rebuildArticleIndex($article);
}
}
@ -408,13 +398,6 @@ class Article extends Service
return $userRepo->findById($id);
}
protected function rebuildArticleCache(ArticleModel $article)
{
$cache = new ArticleCache();
$cache->rebuild($article->id);
}
protected function rebuildArticleIndex(ArticleModel $article)
{
$sync = new ArticleIndexSync();

View File

@ -131,7 +131,6 @@ class Question extends Service
$question->create();
$this->saveDynamicAttrs($question);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
$this->recountUserQuestions($user);
@ -195,7 +194,6 @@ class Question extends Service
$owner = $this->findUser($question->owner_id);
$this->saveDynamicAttrs($question);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
$this->recountUserQuestions($owner);
@ -219,7 +217,6 @@ class Question extends Service
$owner = $this->findUser($question->owner_id);
$this->saveDynamicAttrs($question);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
$this->recountUserQuestions($owner);
@ -238,7 +235,6 @@ class Question extends Service
$owner = $this->findUser($question->owner_id);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
$this->recountUserQuestions($owner);
@ -278,7 +274,6 @@ class Question extends Service
$owner = $this->findUser($question->owner_id);
$this->recountUserQuestions($owner);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
return $question;
@ -313,7 +308,6 @@ class Question extends Service
$owner = $this->findUser($question->owner_id);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
$this->recountUserQuestions($owner);
}
@ -352,7 +346,6 @@ class Question extends Service
$owner = $this->findUser($question->owner_id);
$this->recountUserQuestions($owner);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
}
}
@ -379,7 +372,6 @@ class Question extends Service
$owner = $this->findUser($question->owner_id);
$this->recountUserQuestions($owner);
$this->rebuildQuestionCache($question);
$this->rebuildQuestionIndex($question);
}
}
@ -398,13 +390,6 @@ class Question extends Service
return $userRepo->findById($id);
}
protected function rebuildQuestionCache(QuestionModel $question)
{
$cache = new QuestionCache();
$cache->rebuild($question->id);
}
protected function rebuildQuestionIndex(QuestionModel $question)
{
$sync = new QuestionIndexSync();

View File

@ -8,7 +8,6 @@
namespace Bootstrap;
use App\Library\Logger as AppLogger;
use Phalcon\Logger\Adapter\File as PhLogger;
use Throwable;
class ConsoleErrorHandler extends ErrorHandler
@ -44,9 +43,6 @@ class ConsoleErrorHandler extends ErrorHandler
echo $content . PHP_EOL;
}
/**
* @return PhLogger
*/
protected function getLogger()
{
$logger = new AppLogger();