@php $products = $products ?? collect(); $orders = $orders ?? collect(); $usdPerCredit = (float) ($usdPerCredit ?? 0.001); $usdKrwRate = (float) ($usdKrwRate ?? 1400); $statusLabels = [ 'pending' => '입금대기', 'completed' => '완료', 'cancelled' => '취소', ]; $paymentMethodLabels = [ 'bank_transfer' => '계좌입금', 'card' => '카드', ]; $formatCurrency = static function (float|int|string $value): string { return number_format((float) $value) . '원'; }; $estimateCost = static function (int|float|string $credits) use ($usdPerCredit, $usdKrwRate): int { return (int) round(((float) $credits) * $usdPerCredit * $usdKrwRate); }; $estimateMargin = static function (int|float|string $price, int|float|string $cost): int { return (int) round((float) $price - (float) $cost); }; $estimateMarginRate = static function (int|float|string $price, int|float|string $margin): float { $price = (float) $price; if ($price <= 0) { return 0.0; } return round(((float) $margin / $price) * 100, 1); }; $productModalMap = $products->mapWithKeys(function ($product) use ($estimateCost, $estimateMargin, $estimateMarginRate) { $cost = $estimateCost($product->credits); $margin = $estimateMargin($product->price, $cost); return [ $product->id => [ 'id' => $product->id, 'name' => $product->name, 'credits' => (int) $product->credits, 'price' => (float) $product->price, 'active' => (bool) $product->active, 'sort_order' => (int) $product->sort_order, 'action' => route('platform.credit-topups.products.update', $product), 'cost' => $cost, 'margin' => $margin, 'margin_rate' => $estimateMarginRate($product->price, $margin), 'user_per_credit' => $product->pricePerCredit(), ], ]; })->all(); @endphp
@if (session('status')) {{ session('status') }} @endif @if (isset($errors) && $errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
1 Credit = ${{ rtrim(rtrim(number_format($usdPerCredit, 3, '.', ''), '0'), '.') }} 1 USD = {{ number_format($usdKrwRate) }} KRW 입금 안내 수정 상품 추가
Products

Credit 상품 관리

상품명, 지급 Credit, 판매가격, 활성 여부만 기본 화면에 노출합니다. 정렬은 고급 설정으로 이동했습니다.

예상 기준 원가 = 지급 Credit × 1 Credit당 USD × 기준 환율. 마진 표시는 가격 책정 참고용이며 AI 사용 과금과는 무관합니다.

@if ($products->isEmpty()) @else
@foreach ($products as $product) @php $expectedCost = $estimateCost($product->credits); $expectedMargin = $estimateMargin($product->price, $expectedCost); $expectedMarginRate = $estimateMarginRate($product->price, $expectedMargin); $userPerCredit = $product->pricePerCredit(); @endphp @endforeach
상품 Credit 판매가 1 Credit당 체감가 예상 원가 예상 마진율 상태 관리
{{ $product->name }}
KRW 고정
{{ number_format((int) $product->credits) }}
지급 Credit
{{ $formatCurrency($product->price) }}
{{ number_format($userPerCredit) }}원
크레딧당 가격
약 {{ $formatCurrency($expectedCost) }}
예상 마진 {{ $formatCurrency($expectedMargin) }}
{{ number_format($expectedMarginRate, 1) }}%
{{ $product->active ? '활성' : '비활성' }} 수정
@endif
Orders

Credit 충전 요청 관리

@forelse ($orders as $order) @empty @endforelse
신청일 테넌트 / 신청자 상품 결제금액 지급 Credit 상태 관리
{{ $order->created_at?->format('Y.m.d H:i') }}
{{ $order->tenant?->name ?? $order->tenant_id }}
{{ $order->user?->name ?? '-' }}
{{ $order->product_name_snapshot }}
{{ $paymentMethodLabels[$order->payment_method] ?? $order->payment_method }}
{{ $formatCurrency($order->amount) }} {{ number_format((int) $order->credits) }} {{ $statusLabels[$order->status] ?? $order->status }} @if ($order->status === 'pending')
@csrf 승인
@csrf 취소
@else
@if ($order->status === 'completed') {{ $order->approvedBy?->name ?? '-' }} 승인 @elseif ($order->status === 'cancelled') {{ $order->cancelledBy?->name ?? '-' }} 취소 @else - @endif
@endif
등록된 충전 요청이 없습니다.
@csrf
Credit 상품

상품 추가

상품명, 지급 Credit, 판매가격, 활성 여부만 기본 화면에서 관리합니다.

통화
KRW 고정
활성 여부

비활성화한 상품은 사용자 화면에서 노출되지 않습니다.

예상 원가 / 마진
예상 기준 원가
약 0원
예상 마진
0원
예상 마진율
0.0%

Credit 환산 기준과 기준 환율을 사용한 참고값입니다. 실제 AI 사용 원가와는 별개입니다.

1 Credit당 사용자 체감 가격
0원

판매가를 지급 Credit으로 나눈 값입니다. 실제 AI 과금과는 무관한 판매 단가 참고용입니다.

고급 설정
저장