운영자 화면의 대기 상태 및 통계 기능을 요청하신 대로 세분화하여 업데이트
This commit is contained in:
@@ -238,7 +238,9 @@ try {
|
||||
SELECT
|
||||
COALESCE(SUM(contract_amount), 0) as total_sales,
|
||||
COALESCE(SUM(payout_amount), 0) as total_comm, -- 정산 지급액 합계
|
||||
COUNT(*) as total_count
|
||||
COUNT(*) as total_count,
|
||||
SUM(CASE WHEN join_approved = 0 THEN 1 ELSE 0 END) as pending_join,
|
||||
SUM(CASE WHEN join_approved = 1 AND payment_approved = 0 THEN 1 ELSE 0 END) as pending_payment
|
||||
FROM sales_tenant_products
|
||||
");
|
||||
$tpData = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
@@ -256,7 +258,9 @@ try {
|
||||
$totalStats = [
|
||||
'totalSales' => $tpData['total_sales'] + $srData['total_sales'],
|
||||
'totalCommission' => $tpData['total_comm'] + $srData['total_comm'],
|
||||
'totalCount' => $tpData['total_count'] + $srData['total_count']
|
||||
'totalCount' => $tpData['total_count'] + $srData['total_count'],
|
||||
'pendingJoin' => (int)($tpData['pending_join'] ?? 0),
|
||||
'pendingPayment' => (int)($tpData['pending_payment'] ?? 0)
|
||||
];
|
||||
} else {
|
||||
$totalStats = calculateTotalStats($pdo, $rootUserId, $rootUserId, 0);
|
||||
|
||||
Reference in New Issue
Block a user