diff --git a/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php b/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php index f729d3198..db42a5821 100644 --- a/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php +++ b/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php @@ -107,6 +107,45 @@ $rb_skin['md_auto_is'] 자동롤링 여부(1,0)
$end_date) { + $item['_status'] = '종료'; // 종료 + $item['_sort'] = 3; + } else { + $item['_status'] = '진행'; // 진행 중 + $item['_sort'] = 0; + } + } else { + $item['_status'] = '기타'; + $item['_sort'] = 9; + } + + // 시작일 없을 경우를 고려한 비교용 날짜 (미입력 시 최후순) + $item['_start_date'] = $start_date ? $start_date : '9999-99-99'; + } + unset($item); + + // 정렬: 상태 우선순위(_sort) → 시작일(_start_date) + usort($list, function ($a, $b) { + if ($a['_sort'] === $b['_sort']) { + return strcmp($a['_start_date'], $b['_start_date']); + } + return $a['_sort'] <=> $b['_sort']; + }); + + // 정렬 후 list_count 재설정 (안전) + $list_count = count($list); + for ($i=0; $i<$list_count; $i++) { //썸네일 @@ -139,6 +178,18 @@ $rb_skin['md_auto_is'] 자동롤링 여부(1,0) $end_date = isset($list[$i]['wr_2']) ? $list[$i]['wr_2'] : ''; $rb_ev_ico = ''; + switch ($list[$i]['_status']) { + case '예정': + $rb_ev_ico = '예정'; + break; + case '종료': + $rb_ev_ico = '종료'; + break; + case '진행': + $rb_ev_ico = '진행'; + break; + } + /* switch 로 대체 if($start_date && $end_date) { if ($todays < $start_date) { // 진행 전 @@ -151,6 +202,7 @@ $rb_skin['md_auto_is'] 자동롤링 여부(1,0) $rb_ev_ico = '진행'; } } + */ ?>