From 76b11224301848bc366face6e834cef10a39f2bf Mon Sep 17 00:00:00 2001 From: whitedot Date: Wed, 9 Sep 2026 01:45:45 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=87=BC=ED=95=91=EB=AA=B0=20=EC=B5=9C?= =?UTF-8?q?=ED=95=98=EC=9C=84=20=EB=B6=84=EB=A5=98=EC=97=90=EC=84=9C?= =?UTF-8?q?=EB=8F=84=20=EA=B0=99=EC=9D=80=20=EB=8B=A8=EA=B3=84=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20=EC=9C=A0=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/skin/shop/basic/listcategory.skin.php | 12 ++++++++++-- skin/shop/basic/listcategory.skin.php | 12 ++++++++++-- .../mobile/skin/shop/basic/listcategory.skin.php | 12 ++++++++++-- theme/basic/skin/shop/basic/listcategory.skin.php | 12 ++++++++++-- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/mobile/skin/shop/basic/listcategory.skin.php b/mobile/skin/shop/basic/listcategory.skin.php index 7f0213773..ddd995594 100644 --- a/mobile/skin/shop/basic/listcategory.skin.php +++ b/mobile/skin/shop/basic/listcategory.skin.php @@ -6,15 +6,23 @@ $exists = false; $ca_id_len = strlen($ca_id); $len2 = $ca_id_len + 2; -$len4 = $ca_id_len + 4; $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id "; $result = sql_query($sql); + +// 하위 분류가 없으면 현재 분류를 포함한 같은 단계의 사용 중인 분류를 표시한다. +if (!sql_num_rows($result)) { + $parent_ca_id = substr($ca_id, 0, -2); + $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$parent_ca_id%' and length(ca_id) = $ca_id_len and ca_use = '1' order by ca_order, ca_id "; + $result = sql_query($sql); +} + while ($row=sql_fetch_array($result)) { $row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' "); - $str .= '
  • '.$row['ca_name'].' '.$row2['cnt'].'
  • '; + $current_attr = ($row['ca_id'] === $ca_id) ? ' class="sct_ct_here" aria-current="page"' : ''; + $str .= '
  • '.$row['ca_name'].' '.$row2['cnt'].'
  • '; $exists = true; } diff --git a/skin/shop/basic/listcategory.skin.php b/skin/shop/basic/listcategory.skin.php index a7a3b4208..6f1ad0d40 100644 --- a/skin/shop/basic/listcategory.skin.php +++ b/skin/shop/basic/listcategory.skin.php @@ -6,15 +6,23 @@ $exists = false; $ca_id_len = strlen($ca_id); $len2 = $ca_id_len + 2; -$len4 = $ca_id_len + 4; $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id "; $result = sql_query($sql); + +// 하위 분류가 없으면 현재 분류를 포함한 같은 단계의 사용 중인 분류를 표시한다. +if (!sql_num_rows($result)) { + $parent_ca_id = substr($ca_id, 0, -2); + $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$parent_ca_id%' and length(ca_id) = $ca_id_len and ca_use = '1' order by ca_order, ca_id "; + $result = sql_query($sql); +} + while ($row=sql_fetch_array($result)) { $row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' "); - $str .= '
  • '.$row['ca_name'].' ('.$row2['cnt'].')
  • '; + $current_attr = ($row['ca_id'] === $ca_id) ? ' class="sct_ct_here" aria-current="page"' : ''; + $str .= '
  • '.$row['ca_name'].' ('.$row2['cnt'].')
  • '; $exists = true; } diff --git a/theme/basic/mobile/skin/shop/basic/listcategory.skin.php b/theme/basic/mobile/skin/shop/basic/listcategory.skin.php index 7f0213773..ddd995594 100644 --- a/theme/basic/mobile/skin/shop/basic/listcategory.skin.php +++ b/theme/basic/mobile/skin/shop/basic/listcategory.skin.php @@ -6,15 +6,23 @@ $exists = false; $ca_id_len = strlen($ca_id); $len2 = $ca_id_len + 2; -$len4 = $ca_id_len + 4; $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id "; $result = sql_query($sql); + +// 하위 분류가 없으면 현재 분류를 포함한 같은 단계의 사용 중인 분류를 표시한다. +if (!sql_num_rows($result)) { + $parent_ca_id = substr($ca_id, 0, -2); + $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$parent_ca_id%' and length(ca_id) = $ca_id_len and ca_use = '1' order by ca_order, ca_id "; + $result = sql_query($sql); +} + while ($row=sql_fetch_array($result)) { $row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' "); - $str .= '
  • '.$row['ca_name'].' '.$row2['cnt'].'
  • '; + $current_attr = ($row['ca_id'] === $ca_id) ? ' class="sct_ct_here" aria-current="page"' : ''; + $str .= '
  • '.$row['ca_name'].' '.$row2['cnt'].'
  • '; $exists = true; } diff --git a/theme/basic/skin/shop/basic/listcategory.skin.php b/theme/basic/skin/shop/basic/listcategory.skin.php index a7a3b4208..6f1ad0d40 100644 --- a/theme/basic/skin/shop/basic/listcategory.skin.php +++ b/theme/basic/skin/shop/basic/listcategory.skin.php @@ -6,15 +6,23 @@ $exists = false; $ca_id_len = strlen($ca_id); $len2 = $ca_id_len + 2; -$len4 = $ca_id_len + 4; $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id "; $result = sql_query($sql); + +// 하위 분류가 없으면 현재 분류를 포함한 같은 단계의 사용 중인 분류를 표시한다. +if (!sql_num_rows($result)) { + $parent_ca_id = substr($ca_id, 0, -2); + $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$parent_ca_id%' and length(ca_id) = $ca_id_len and ca_use = '1' order by ca_order, ca_id "; + $result = sql_query($sql); +} + while ($row=sql_fetch_array($result)) { $row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' "); - $str .= '
  • '.$row['ca_name'].' ('.$row2['cnt'].')
  • '; + $current_attr = ($row['ca_id'] === $ca_id) ? ' class="sct_ct_here" aria-current="page"' : ''; + $str .= '
  • '.$row['ca_name'].' ('.$row2['cnt'].')
  • '; $exists = true; }