From f25354b1b22174c8794dce5142b2d7147f192a43 Mon Sep 17 00:00:00 2001 From: loves2tu Date: Tue, 28 Dec 2021 05:46:48 +0000 Subject: [PATCH] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=ED=8C=90=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=EC=84=BC=ED=84=B0=20=ED=94=BC=EB=93=9C=20=20-=20?= =?UTF-8?q?=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80=20(it?= =?UTF-8?q?=5Fid,=20it=5Fname)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/price/google_feed.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 14a360217..0ba4e8589 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -10,9 +10,9 @@ $sql = "SELECT a.ca_id, FROM `g5_shop_category` AS a"; $result = sql_query($sql); -$category_array = array(); +$category_adult_array = array(); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { - $category_array[$row['ca_id']] = array( $row['ca_adult'], // 자기자신 성인인증판단 + $category_adult_array[$row['ca_id']] = array( $row['ca_adult'], // 자기자신 성인인증판단 $row['ca_adult_parent1'], // 1depth 성인인증 $row['ca_adult_parent2'], // 2depth 성인인증 $row['ca_adult_parent3'], // 3depth 성인인증 @@ -33,13 +33,10 @@ $link = $channel->addChild("link", G5_URL); $description = $channel->addChild("description", "몰?루"); for ($i = 0; $row = sql_fetch_array($result); $i++ ) { - $stock = "in_stock"; - if($row['in_stock'] != null) { - if($row['in_stock'] <= 0) $stock = "out_of_stock"; - } + if(empty($row['it_id'])) continue; + if(empty($row['it_name'])) continue; if(empty($row['it_img1'])) continue; if(!file_exists(G5_DATA_PATH.'/item/'.$row['it_img1'])) continue; - $ext = explode('.', $row['it_img1'])[1]; switch($ext) { @@ -59,6 +56,11 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { } if($ext_check == false) continue; + + $stock = "in_stock"; + if($row['in_stock'] != null) { + if($row['in_stock'] <= 0) $stock = "out_of_stock"; + } $item = $channel->addChild("item"); // 필수 입력 항목 @@ -83,7 +85,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { $adult = "no"; foreach($cate_array as $key => $var) { - if(in_array(1, $category_array[$var])) { + if(in_array(1, $category_adult_array[$var])) { $adult = "yes"; } }