diff --git a/shop/price/google_feed.php b/shop/price/google_feed.php index 8e395652e..cd919fd9e 100644 --- a/shop/price/google_feed.php +++ b/shop/price/google_feed.php @@ -19,7 +19,7 @@ for ($i = 0; $row = sql_fetch_array($result); $i++ ) { $row['ca_adult_parent4']); // 4depth 성인인증 } -$sql =" SELECT a.*, (SELECT MIN(`io_stock_qty`) FROM `{$g5['g5_shop_item_option_table']}` WHERE `it_id` = a.`it_id` GROUP BY `it_id`) AS in_stock +$sql =" SELECT a.*, IFNULL((SELECT MIN(`io_stock_qty`) FROM `{$g5['g5_shop_item_option_table']}` WHERE `it_id` = a.`it_id` GROUP BY `it_id`), a.`it_stock_qty`) AS in_stock FROM `{$g5['g5_shop_item_table']}` as a where a.`it_use` = '1' and a.`it_soldout` = '0' and a.`it_tel_inq` = '0' and a.`it_price` > '0' order by a.`ca_id`"; $result = sql_query($sql); @@ -49,7 +49,9 @@ for ($i = 0; $row = sql_fetch_array($result); $i++) { } $stock = "in_stock"; - if($row['in_stock'] != null) { + if($row['it_stock_qty'] <= 0) { + $stock = "out_of_stock"; + } else { if($row['in_stock'] <= 0) $stock = "out_of_stock"; }