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();