diff --git a/shop/price/naver.php b/shop/price/naver.php index 8a74433e9..b348bc55d 100644 --- a/shop/price/naver.php +++ b/shop/price/naver.php @@ -45,25 +45,28 @@ $result = sql_query($sql); for ($i=0; $row=sql_fetch_array($result); $i++) { - $cate1 = $cate2 = $cate3 = $cate4 = ""; + $cate1 = $cate2 = $cate3 = $cate4 = ''; + $caid1 = $caid2 = $caid3 = $caid4 = ''; + $caid1 = substr($row['ca_id'],0,2); $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' "); - $cate1 = $row2['ca_name']; - - $cate2 = $cate3 = $cate4 = ""; + $cate1 = $row2['ca_name']; if (strlen($row['ca_id']) >= 8) { - $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' "); + $caid4 = substr($row['ca_id'],0,8); + $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' "); $cate4 = $row2['ca_name']; } if (strlen($row['ca_id']) >= 6) { - $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' "); + $caid3 = substr($row['ca_id'],0,6); + $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' "); $cate3 = $row2['ca_name']; } if (strlen($row['ca_id']) >= 4) { - $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' "); + $caid2 = substr($row['ca_id'],0,4); + $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' "); $cate2 = $row2['ca_name']; } diff --git a/shop/price/naver_summary.php b/shop/price/naver_summary.php index 8f5390ebc..fa9f8d97e 100644 --- a/shop/price/naver_summary.php +++ b/shop/price/naver_summary.php @@ -45,25 +45,28 @@ $result = sql_query($sql); for ($i=0; $row=sql_fetch_array($result); $i++) { - $cate1 = $cate2 = $cate3 = $cate4 = ""; + $cate1 = $cate2 = $cate3 = $cate4 = ''; + $caid1 = $caid2 = $caid3 = $caid4 = ''; + $caid1 = substr($row['ca_id'],0,2); $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' "); $cate1 = $row2['ca_name']; - $cate2 = $cate3 = $cate4 = ""; - if (strlen($row['ca_id']) >= 8) { - $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' "); + $caid4 = substr($row['ca_id'],0,8); + $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' "); $cate4 = $row2['ca_name']; } if (strlen($row['ca_id']) >= 6) { - $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' "); + $caid3 = substr($row['ca_id'],0,6); + $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' "); $cate3 = $row2['ca_name']; } if (strlen($row['ca_id']) >= 4) { - $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' "); + $caid2 = substr($row['ca_id'],0,4); + $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' "); $cate2 = $row2['ca_name']; }