From dcf03e5620a47308c8d99869e09a0eef77ef4559 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Wed, 10 Apr 2024 18:58:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3chapter=5Fuser=E4=B8=ADdura?= =?UTF-8?q?tion=E9=87=8D=E5=A4=8D=E8=AE=A1=E6=95=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Tasks/SyncLearningTask.php | 2 +- app/Services/Logic/Chapter/Learning.php | 4 ++-- app/Services/Sync/Learning.php | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/Console/Tasks/SyncLearningTask.php b/app/Console/Tasks/SyncLearningTask.php index e1c5f639..7ff9c90f 100644 --- a/app/Console/Tasks/SyncLearningTask.php +++ b/app/Console/Tasks/SyncLearningTask.php @@ -69,7 +69,7 @@ class SyncLearningTask extends Task } else { - $dbLearning->duration += $cacheLearning->duration; + $dbLearning->duration = $cacheLearning->duration; $dbLearning->position = $cacheLearning->position; $dbLearning->active_time = $cacheLearning->active_time; diff --git a/app/Services/Logic/Chapter/Learning.php b/app/Services/Logic/Chapter/Learning.php index b3a003d6..78aceedd 100644 --- a/app/Services/Logic/Chapter/Learning.php +++ b/app/Services/Logic/Chapter/Learning.php @@ -23,9 +23,9 @@ class Learning extends LogicService { $post = $this->request->getPost(); - $chapter = $this->checkChapter($id); + $chapter = $this->checkChapterCache($id); - $user = $this->getLoginUser(); + $user = $this->getLoginUser(true); $validator = new LearningValidator(); diff --git a/app/Services/Sync/Learning.php b/app/Services/Sync/Learning.php index 868e004a..2acfe430 100644 --- a/app/Services/Sync/Learning.php +++ b/app/Services/Sync/Learning.php @@ -21,10 +21,6 @@ class Learning extends AppService */ protected $lifetime = 86400; - /** - * @param LearningModel $learning - * @param int $intervalTime - */ public function addItem(LearningModel $learning, $intervalTime = 10) { $cache = $this->getCache();