style: Pint 포맷팅 적용
This commit is contained in:
@@ -44,8 +44,8 @@ public function index(Request $request): View|Response
|
||||
$startDate = "{$year}-01-01 00:00:00";
|
||||
$endDate = "{$year}-12-31 23:59:59";
|
||||
} elseif ($viewType === 'custom') {
|
||||
$startDate = $request->input('start_date', date('Y-m-01')) . ' 00:00:00';
|
||||
$endDate = $request->input('end_date', date('Y-m-t')) . ' 23:59:59';
|
||||
$startDate = $request->input('start_date', date('Y-m-01')).' 00:00:00';
|
||||
$endDate = $request->input('end_date', date('Y-m-t')).' 23:59:59';
|
||||
} else {
|
||||
$startDate = "{$year}-{$month}-01 00:00:00";
|
||||
$endDate = date('Y-m-t 23:59:59', strtotime($startDate));
|
||||
@@ -116,7 +116,7 @@ private function getAllTenantsUsage(string $startDate, string $endDate, string $
|
||||
$tenantId = $row->tenant_id;
|
||||
$month = $row->month;
|
||||
|
||||
if (!isset($monthlyData[$tenantId])) {
|
||||
if (! isset($monthlyData[$tenantId])) {
|
||||
$monthlyData[$tenantId] = [];
|
||||
}
|
||||
$monthlyData[$tenantId][$month] = $row->total_count;
|
||||
@@ -173,7 +173,7 @@ private function getAllTenantsUsage(string $startDate, string $endDate, string $
|
||||
}
|
||||
|
||||
// 정렬: 조회 건수 내림차순
|
||||
usort($details, fn($a, $b) => $b['count'] - $a['count']);
|
||||
usort($details, fn ($a, $b) => $b['count'] - $a['count']);
|
||||
|
||||
return [
|
||||
'total_count' => $totalCount,
|
||||
@@ -228,7 +228,7 @@ private function getSingleTenantUsage(int $tenantId, string $startDate, string $
|
||||
$existingMonths = collect($details)->pluck('month')->toArray();
|
||||
for ($m = 1; $m <= 12; $m++) {
|
||||
$monthKey = sprintf('%s-%02d', $year, $m);
|
||||
if (!in_array($monthKey, $existingMonths)) {
|
||||
if (! in_array($monthKey, $existingMonths)) {
|
||||
$details[] = [
|
||||
'tenant_id' => $tenantId,
|
||||
'tenant_name' => $tenant?->company_name ?? '(삭제됨)',
|
||||
@@ -241,7 +241,7 @@ private function getSingleTenantUsage(int $tenantId, string $startDate, string $
|
||||
}
|
||||
}
|
||||
// 월 순서로 정렬
|
||||
usort($details, fn($a, $b) => strcmp($a['month'], $b['month']));
|
||||
usort($details, fn ($a, $b) => strcmp($a['month'], $b['month']));
|
||||
}
|
||||
|
||||
return [
|
||||
@@ -257,6 +257,7 @@ private function getSingleTenantUsage(int $tenantId, string $startDate, string $
|
||||
private function calculateFee(int $count): int
|
||||
{
|
||||
$paidCount = max(0, $count - self::FREE_MONTHLY_QUOTA);
|
||||
|
||||
return $paidCount * self::ADDITIONAL_FEE_PER_INQUIRY;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user