diff --git a/hwe/sammo/API/InheritAction/GetMoreLog.php b/hwe/sammo/API/InheritAction/GetMoreLog.php new file mode 100644 index 00000000..70466410 --- /dev/null +++ b/hwe/sammo/API/InheritAction/GetMoreLog.php @@ -0,0 +1,40 @@ +args); + $v->rule('integer', 'lastID'); + if (!$v->validate()) { + return $v->errorStr(); + } + $this->args['lastID'] = Util::toInt($this->args['lastID']); + return null; + } + function getRequiredSessionMode(): int + { + return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; + } + + function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag) + { + $userID = $session->userID; + $lastID = $this->args['lastID']; + $db = DB::db(); + $lastInheritPointLogs = $db->query('SELECT id, server_id, year, month, date, text FROM user_record WHERE log_type = %s AND `user_id` = %i AND id < %i ORDER BY id desc LIMIT 30', "inheritPoint", $userID, $lastID); + + return [ + 'result'=> true, + 'log' => $lastInheritPointLogs, + ]; + } +} diff --git a/hwe/ts/PageInheritPoint.vue b/hwe/ts/PageInheritPoint.vue index e97ef8f2..36a2195d 100644 --- a/hwe/ts/PageInheritPoint.vue +++ b/hwe/ts/PageInheritPoint.vue @@ -70,7 +70,7 @@