fix cleanup do not run under secret login

This commit is contained in:
xiaomlove
2022-04-10 17:39:25 +08:00
parent b7c1102500
commit 8216cb364c
5 changed files with 8 additions and 9 deletions
+1 -6
View File
@@ -78,15 +78,10 @@ class Handler extends ExceptionHandler
{
$data = $request->all();
$httpStatusCode = $this->getHttpStatusCode($e);
if ($httpStatusCode == 200) {
$msg = $e->getMessage() ?: get_class($e);
} else {
$msg = 'Server Error';
}
$msg = $e->getMessage();
$trace = $e->getTraceAsString();
if (config('app.debug')) {
$data['trace'] = $e->getTraceAsString();
$data['trace'] = $trace;
}
return new JsonResponse(
fail($msg, $data),
+1 -1
View File
@@ -128,7 +128,7 @@ class PollController extends Controller
->selectRaw("selection, count(*) as count")->groupBy("selection")
->get()->pluck('count', 'selection')->toArray();
foreach ($answerStats as $index => &$value) {
$value = number_format(($value / $poll->answers_count) * 100, 2) . '%';
$value = number_format(($value / $poll->answers_count) * 100, 1) . '%';
}
$resource = new PollResource($poll);
} else {