fix(performance): 카페24 market_id 의 자체몰 채널(모바일웹·네이버페이·톡체크아웃)을 자체몰로 분류

실데이터 대조 결과 "다른 마켓 연동"으로 보이던 주문은 mobile(모바일웹)·NCHECKOUT(네이버페이)·
KAKAOPAY(톡체크아웃) — 모두 카페24 자체몰 주문. 금액은 이미 카페24 열이었지만 대조 표시가 오해를 불렀다.

- SELF_CHANNELS 로 자체몰 채널 명시, channel_kind(self/market/unknown)
- MARKET_MAP 에서 결제수단과 헷갈리는 일반 이름(naver, kakao 등) 제거
- 매출 대조: "카페24 열 / 다른 쇼핑몰 열" + "주문 채널별" 표(자체몰 채널/외부 마켓/알 수 없는 채널)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 16:59:16 +09:00
parent 19396f1745
commit f63f82d642
6 changed files with 92 additions and 57 deletions
+9 -7
View File
@@ -512,27 +512,29 @@
["순매출(결제합계 − 환불합계)", s.total - rs.actual_refund_amount, m.total - rm.actual_refund_amount, "key"],
]);
out.innerHTML = '<table class="perf-table" style="margin-top:8px"><thead><tr><th class="perf-th-label">' + esc(r.date) +
"</th><th>자체몰(카페24 열)</th><th>다른 마켓 연동(해당 쇼핑몰 열)</th></tr></thead><tbody>" +
"</th><th>카페24 열(자체몰 채널)</th><th>다른 쇼핑몰 열(외부 마켓)</th></tr></thead><tbody>" +
rows.map(function (x) {
const cls = x[3] === "key" ? ' class="perf-row-week"' : "";
const f = function (v) { return x[3] === "cnt" ? fmt(v) : won(v); };
return "<tr" + cls + '><th class="perf-td-label' + (x[3] === "sub" ? " perf-muted" : "") + '">' + esc(x[0]) +
'</th><td class="perf-num">' + f(x[1]) + '</td><td class="perf-num">' + f(x[2]) + "</td></tr>";
}).join("") + "</tbody></table>" +
((r.by_market || []).length
? '<h4 class="perf-h" style="margin:14px 0 6px">다른 마켓 연동 주문 — 마켓별</h4>' +
((r.by_channel || []).length
? '<h4 class="perf-h" style="margin:14px 0 6px">주문 채널별</h4>' +
'<table class="perf-table"><thead><tr><th class="perf-th-label">market_id</th><th class="perf-th-label">주문경로</th>' +
'<th class="perf-th-label">반영 열</th><th>주문수</th><th>결제합계</th><th>환불</th><th>순매출</th></tr></thead><tbody>' +
r.by_market.map(function (b) {
'<th class="perf-th-label">구분</th><th class="perf-th-label">반영 열</th><th>주문수</th><th>결제합계</th><th>환불</th><th>순매출</th></tr></thead><tbody>' +
r.by_channel.map(function (b) {
const col = MARKET_NAMES[b.target] || b.target;
const kind = b.kind === "self" ? "자체몰 채널" + (b.label ? "(" + b.label + ")" : "")
: b.kind === "market" ? "외부 마켓" : '<span class="perf-err" style="display:inline">알 수 없는 채널</span>';
return '<tr><td class="perf-td-label">' + esc(b.market_id) + "</td><td>" + esc((b.names || []).join(", ")) +
"</td><td>" + esc(col) + (b.target === "cafe24" ? ' <span class="perf-muted">(연결표 없음)</span>' : "") +
"</td><td>" + (b.kind === "unknown" ? kind : esc(kind)) + "</td><td>" + esc(col) +
'</td><td class="perf-num">' + fmt(b.orders) + '</td><td class="perf-num">' + won(b.total) +
'</td><td class="perf-num">' + won(-b.refund_amount) + '</td><td class="perf-num">' + won(b.total - b.refund_amount) + "</td></tr>";
}).join("") + "</tbody></table>"
: "") +
'<p class="perf-foot perf-muted">' + esc(r.formula) + ". 미결제 주문 " + fmt(r.unpaid_orders) +
"건 제외. 카페24 화면과 다른 줄이 있으면 알려 주세요 — 규칙을 맞추겠습니다.</p>";
"건 제외. \"알 수 없는 채널\"은 카페24 열에 넣습니다 — 외부 마켓이면 어느 쇼핑몰인지 알려 주세요.</p>";
} catch (err) {
out.innerHTML = '<p class="perf-notice is-warn">' + esc(err.message) + "</p>";
} finally { recon.disabled = false; }