@extends('admin.layouts.app') @section('title', '회원 관리') @section('page_title', '회원 관리') @section('page_desc', '회원상태/기본정보/인증을 조회합니다.') @section('content_class', 'a-content--full') @push('head') @endpush @section('content') @php // stat_3 매핑 (1~6) $stat3Map = $stat3Map ?? [ '1' => '1. 로그인정상', '2' => '2. 로그인만가능', '3' => '3. 로그인불가(접근금지)', '4' => '4. 탈퇴완료(아이디보관)', '5' => '5. 탈퇴완료', '6' => '6. 휴면회원', ]; // stat_3 pill 색상 $stat3Pill = function(string $s3): string { return match ($s3) { '1' => 'pill--ok', '2' => 'pill--warn', '3' => 'pill--bad', '4', '5' => 'pill--muted', '6' => 'pill--warn', default => 'pill--muted', }; }; // 성별 라벨 $genderLabel = function(?string $g): string { $g = (string)($g ?? ''); return match ($g) { '1' => '남자', '0' => '여자', default => '-', }; }; // 세는나이: 현재년도 - 출생년도 + 1 $koreanAge = function($birth): ?int { $b = (string)($birth ?? ''); if ($b === '' || $b === '0000-00-00') return null; try { $y = \Carbon\Carbon::parse($b)->year; if ($y < 1900) return null; return (int) now()->year - $y + 1; } catch (\Throwable $e) { return null; } }; // 만나이: 생일 지났으면 diffInYears 그대로, 아니면 -1 반영되는 Carbon diffInYears 사용 $manAge = function($birth): ?int { $b = (string)($birth ?? ''); if ($b === '' || $b === '0000-00-00') return null; try { $dob = \Carbon\Carbon::parse($b); if ($dob->year < 1900) return null; return (int) $dob->diffInYears(now()); // full years } catch (\Throwable $e) { return null; } }; // authMap 어떤 형태든 Y만 뽑기 (email/cell/account만, vow/otp는 제외) $pickAuthOk = function($auth): array { $out = ['email'=>false,'cell'=>false,'account'=>false]; $stateOf = function($v): string { if (is_string($v)) return $v; if (is_array($v)) { if (isset($v['auth_state'])) return (string)$v['auth_state']; if (isset($v['state'])) return (string)$v['state']; return ''; } if (is_object($v)) { if (isset($v->auth_state)) return (string)$v->auth_state; if (isset($v->state)) return (string)$v->state; return ''; } return ''; }; // assoc if (is_array($auth) && (array_key_exists('email',$auth) || array_key_exists('cell',$auth) || array_key_exists('account',$auth))) { foreach (['email','cell','account'] as $t) { $out[$t] = ($stateOf($auth[$t] ?? '') === 'Y'); } return $out; } // rows list if (is_array($auth)) { foreach ($auth as $row) { $type = ''; $state = ''; if (is_array($row)) { $type = (string)($row['auth_type'] ?? $row['type'] ?? ''); $state = (string)($row['auth_state'] ?? $row['state'] ?? ''); } elseif (is_object($row)) { $type = (string)($row->auth_type ?? $row->type ?? ''); $state = (string)($row->auth_state ?? $row->state ?? ''); } if (in_array($type, ['email','cell','account'], true) && $state === 'Y') { $out[$type] = true; } } return $out; } return $out; }; $qf = (string)($filters['qf'] ?? 'all'); @endphp
회원 관리
회원상태/기본정보/인증을 조회합니다.
초기화
{{ $page->total() }}
@forelse($page as $m) @php $no = (int)($m->mem_no ?? 0); $gender = $genderLabel($m->gender ?? null); $ageK = $koreanAge($m->birth ?? null); $ageM = $manAge($m->birth ?? null); $s3 = (string)($m->stat_3 ?? ''); $s3Label = $stat3Map[$s3] ?? ($s3 !== '' ? $s3 : '-'); $s3Pill = $stat3Pill($s3); $authRaw = $authMap[$no] ?? ($authMap[(string)$no] ?? null); $ok = $pickAuthOk($authRaw); $joinAt = $m->dt_reg ?? '-'; @endphp {{-- 성명 --}} {{-- 성별/나이(세는나이 + 만나이) --}} {{-- 이메일 --}} {{-- 회원상태(색상 분기) --}} {{-- 인증: Y만 표시 --}} {{-- 가입일 --}} @empty @endforelse
MEM_NO 성명 성별/나이 이메일 회원상태 인증(Y만) 가입일 관리
{{ $no }}
{{ $m->name ?? '-' }}
{{ $gender }} @if($ageK !== null || $ageM !== null) {{ $ageK !== null ? "{$ageK}세" : '-' }} (만 {{ $ageM !== null ? "{$ageM}세" : '-' }}) @else - @endif
@if(!empty($m->email)) {{ $m->email }} @else - @endif ● {{ $s3Label }}
@if($ok['email']) 이메일 @endif @if($ok['cell']) 휴대폰 @endif @if($ok['account']) 계좌 @endif @if(!$ok['email'] && !$ok['cell'] && !$ok['account']) - @endif
{{ $joinAt }} 보기
데이터가 없습니다.
{{ $page->links() }}
@endsection