- tenantStats 데이터 추가 (관리 테넌트, 총 가입비 실적, 누적 가입비 수당, 확정 가입비 수당) - 실적 데이터 없음 안내 섹션 추가 - 수익 및 테넌트 관리 통계 카드 4개 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
89 lines
2.9 KiB
PHP
89 lines
2.9 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Sales;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\View\View;
|
|
|
|
/**
|
|
* 영업관리 대시보드 컨트롤러
|
|
*/
|
|
class SalesDashboardController extends Controller
|
|
{
|
|
/**
|
|
* 대시보드 화면
|
|
*/
|
|
public function index(Request $request): View
|
|
{
|
|
// 기간 설정
|
|
$period = $request->input('period', 'month'); // month or custom
|
|
$year = $request->input('year', now()->year);
|
|
$month = $request->input('month', now()->month);
|
|
|
|
// 기간 설정 모드일 경우
|
|
if ($period === 'custom') {
|
|
$startDate = $request->input('start_date', now()->startOfMonth()->format('Y-m-d'));
|
|
$endDate = $request->input('end_date', now()->format('Y-m-d'));
|
|
} else {
|
|
$startDate = now()->startOfMonth()->format('Y-m-d');
|
|
$endDate = now()->endOfMonth()->format('Y-m-d');
|
|
}
|
|
|
|
// 통계 데이터 (임시 데이터 - 추후 실제 데이터로 교체)
|
|
$stats = [
|
|
'total_membership_fee' => 0, // 총 가입비
|
|
'total_commission' => 0, // 총 수당
|
|
'commission_rate' => 0, // 지급 승인 완료 비율
|
|
'total_contracts' => 0, // 전체 건수
|
|
'pending_membership_approval' => 0, // 가입 승인 대기
|
|
'pending_payment_approval' => 0, // 지급 승인 대기
|
|
];
|
|
|
|
// 역할별 수당 상세
|
|
$commissionByRole = [
|
|
[
|
|
'name' => '판매자',
|
|
'rate' => 20,
|
|
'amount' => 0,
|
|
'color' => 'green',
|
|
],
|
|
[
|
|
'name' => '관리자',
|
|
'rate' => 5,
|
|
'amount' => 0,
|
|
'color' => 'blue',
|
|
],
|
|
[
|
|
'name' => '매뉴제작 협업수당',
|
|
'rate' => null, // 별도
|
|
'amount' => null, // 운영팀 산정
|
|
'color' => 'red',
|
|
],
|
|
];
|
|
|
|
// 총 가입비 대비 수당
|
|
$totalCommissionRatio = 0;
|
|
|
|
// 수익 및 테넌트 관리 통계 (임시 데이터 - 추후 실제 데이터로 교체)
|
|
$tenantStats = [
|
|
'total_tenants' => 0, // 관리 테넌트
|
|
'total_membership_revenue' => 0, // 총 가입비 실적
|
|
'total_commission_accumulated' => 0, // 누적 가입비 수당
|
|
'confirmed_commission' => 0, // 확정 가입비 수당
|
|
];
|
|
|
|
return view('sales.dashboard.index', compact(
|
|
'stats',
|
|
'commissionByRole',
|
|
'totalCommissionRatio',
|
|
'tenantStats',
|
|
'period',
|
|
'year',
|
|
'month',
|
|
'startDate',
|
|
'endDate'
|
|
));
|
|
}
|
|
}
|