diff --git a/public_html/doc/forecast_list.php b/public_html/doc/forecast_list.php index ee8a1ae..8a294cb 100644 --- a/public_html/doc/forecast_list.php +++ b/public_html/doc/forecast_list.php @@ -12,6 +12,14 @@ if($orderdate == "") { $func -> modalMsg ($msg, "/index_intranet.php?view=forecast"); exit(); } + +// 선택 날짜에 휴무인 가게 경고용 (오픈여부 판정 라이브러리 재사용) +// $orderdate 는 아래에서 str_replace 로 'YYYYMMDD' 로 변형되므로 원본 'YYYY-MM-DD' 를 먼저 보관 +$orderdateForCheck = $orderdate; +require_once getenv("DOCUMENT_ROOT")."/assets/dbCon.php"; +// dbCon 이 전역 mysqli 리포트 모드를 STRICT 로 바꾸므로, 이후 $jdb 쿼리에 영향 없도록 legacy(OFF)로 원복 +if (function_exists('mysqli_report')) { mysqli_report(MYSQLI_REPORT_OFF); } +require_once getenv("DOCUMENT_ROOT")."/lib/customer_open_status.php"; // Forecast 기능 제한 (Admin : 1, Staff : 5, Driver : 9 만 가능) $permit = array("1", "5", "9"); @@ -389,6 +397,20 @@ if ($customer_uids) { } } +// === 선택 날짜(orderdate)에 휴무인 가게 판정 (일반/Request/Scheduled 전체 uid 대상) === +// $closedSet[c_uid] = 'closing_day' | 'day_off' (닫힌 가게만 등록) +$closedSet = []; +$__allUids = array_values(array_unique(array_merge( + (array)$customer_uids, (array)$uids_R, (array)$uids_P))); +if (!empty($__allUids)) { + $__closeStat = customersOpenStatus($__allUids, strtotime($orderdateForCheck), true); + foreach ($__closeStat as $__cid => $__st) { + if (!empty($__st['restricted']) && empty($__st['open'])) { + $closedSet[(int)$__cid] = $__st['reason']; + } + } +} + $totalrowcnt = 1; $list_number = 1; @@ -476,7 +498,7 @@ foreach ($rows as $list) { } $strList .= " -