attempt to fix again

This commit is contained in:
Pig Fang 2019-02-16 18:16:57 +08:00
parent fe821c3e8b
commit 14f80ab573

View File

@ -92,13 +92,14 @@ class UserController extends Controller
$user = Auth::user();
if ($user->canSign()) {
$acquiredScore = $user->sign();
$gap = option('sign_gap_time');
return json([
'errno' => 0,
'msg' => trans('user.sign-success', ['score' => $acquiredScore]),
'score' => $user->getScore(),
'storage' => $this->calculatePercentageUsed($user->getStorageUsed(), option('score_per_storage')),
'remaining_time' => $this->getUserSignRemainingTimeWithPrecision($user)
'remaining_time' => $gap > 1 ? round($gap) : $gap
]);
} else {
$remaining_time = $this->getUserSignRemainingTimeWithPrecision();