Skip to content

Commit

Permalink
fix: 更新被提问者的问答数时找不到被提问者
Browse files Browse the repository at this point in the history
(cherry picked from commit f30866e)
  • Loading branch information
lddtime committed Nov 16, 2020
1 parent ff7387d commit 72f06d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Listeners/Thread/ThreadListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,13 @@ private function updateThreadCount(Thread $thread)
// 用户主题数
$user->refreshThreadCount();

//用户提问数
// 用户提问数
if ($thread->type == Thread::TYPE_OF_QUESTION) {
$user->refreshQuestionCount();
$thread->question->beUser->refreshQuestionCount()->save();

if ($thread->question && $thread->question->beUser) {
$thread->question->beUser->refreshQuestionCount()->save();
}
}

$user->save();
Expand Down

0 comments on commit 72f06d3

Please sign in to comment.