From 000efdd4d49cf2aad6c0f802ae9df89748971d97 Mon Sep 17 00:00:00 2001 From: Hyojin Ahn Date: Mon, 20 Apr 2026 13:16:41 -0400 Subject: [PATCH] =?UTF-8?q?v1.1.13=20-=20[ORDER]=20Ghost=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=20=EB=A1=9C=EC=A7=81=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/assets/api/daily.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/public_html/assets/api/daily.php b/public_html/assets/api/daily.php index 5ace0ac..f99225d 100644 --- a/public_html/assets/api/daily.php +++ b/public_html/assets/api/daily.php @@ -656,7 +656,8 @@ class DailyService extends CONF { $ordertype = $after['d_ordertype'] ?? 'N'; $orderdate = $after['d_orderdate'] ?? ''; $visitdate = $after['d_visitdate'] ?? ''; - $quantity = (int)($after['d_quantity'] ?? 0); + $thisQuantity= (int)($after['d_quantity'] ?? 0); + $lastQuantity= (int)($after['d_lastpickupquantity'] ?? 0); $paystatus = $after['d_paystatus'] ?? ''; $paymenttype = $after['d_paymenttype'] ?? ''; @@ -665,11 +666,11 @@ class DailyService extends CONF { // -------------------------------------------------- // 0) Ghost Check // -------------------------------------------------- - if ($quantity < 10 && $isTop !== 'G') { + if ($thisQuantity < 10 && $lastQuantity < 10 && $isTop !== 'G') { $updateFields[] = "c_is_top = 'G'"; } - if ($isTop === 'G' && $quantity >= 10) { + if ($isTop === 'G' && $thisQuantity >= 10) { $updateFields[] = "c_is_top = ''"; } @@ -1054,7 +1055,7 @@ class DailyService extends CONF { $connect = $GLOBALS['conn']; $res = mysqli_query($connect, " - SELECT d_quantity + SELECT d_quantity, d_lastpickupquantity FROM tbl_daily WHERE d_customeruid = '{$customerUid}' AND d_status = 'F' @@ -1065,18 +1066,20 @@ class DailyService extends CONF { $row = mysqli_fetch_assoc($res); if (!$row) { - // 데이터 없으면 ghost 해제 + // 데이터 없으면 ghost 였던 것 해제 mysqli_query($connect, " UPDATE tbl_customer SET c_is_top = '' WHERE c_uid = '{$customerUid}' + and c_is_top = 'G' "); return; } - $qty = (int)$row['d_quantity']; + $thisQuantity = (int)$row['d_quantity']; + $lastQuantity = (int)$row['d_lastpickupquantity']; - if ($qty < 10) { + if ($thisQuantity < 10 && $lastQuantity < 10) { mysqli_query($connect, " UPDATE tbl_customer SET c_is_top = 'G' @@ -1087,6 +1090,7 @@ class DailyService extends CONF { UPDATE tbl_customer SET c_is_top = '' WHERE c_uid = '{$customerUid}' + and c_is_top = 'G' "); } }