From 9a275fb5300cb61d4a47c44eb116b6557a72f45e Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 16 Nov 2016 08:45:50 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EC=8B=9D=EC=87=BC=ED=95=91EP=20?= =?UTF-8?q?=EB=B6=84=EB=A5=98=EB=AA=85=20=EC=B6=9C=EB=A0=A5=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/naver.php | 17 ++++++++++------- shop/price/naver_summary.php | 15 +++++++++------ 2 files changed, 19 insertions(+), 13 deletions(-) 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']; }