diff --git a/public_html/assets/api/install.php b/public_html/assets/api/install.php index 9087f0f..d579391 100644 --- a/public_html/assets/api/install.php +++ b/public_html/assets/api/install.php @@ -559,6 +559,9 @@ trait InstallAPI { di.di_lng, di.di_work_type, di.di_status, + di.di_request_note, + di.di_cs_note, + di.di_work_note, c.c_name AS di_customer_name, SUM( CASE @@ -776,12 +779,19 @@ trait InstallAPI { $base_seq = 0; - if (!$has_existing && $has_trial) { + if ($has_existing) { + $seq_values = array_map(function($r){ + return intval($r['di_order_seq'] ?? 0); + }, $existing_rows); + + $min_seq = min(array_filter($seq_values)); + $base_seq = $min_seq - 1; + } else if ($has_trial) { $qr_max = qry(" SELECT MAX(di_order_seq) AS max_seq FROM tbl_daily_install WHERE di_driver_uid = '{$di_driver_uid}' - AND di_install_date = '{$di_install_date}' + AND di_install_date = '{$di_install_date}' "); $row_max = fetch_array($qr_max); @@ -2197,6 +2207,7 @@ trait InstallAPI { public function daily_install_reorder() { $driver_uid = intval($_POST['driver_uid'] ?? 0); + $install_date = trim($_POST['install_date'] ?? ''); $orderJson = $_POST['order_list'] ?? ''; $fail = function($stage, $msg, $extra = []) { @@ -2218,21 +2229,6 @@ trait InstallAPI { $fail('decode', 'invalid order list'); } - // driver의 install_date는 하나라고 가정 (화면 기준) - $qr = qry(" - SELECT di_install_date - FROM tbl_daily_install - WHERE di_driver_uid = '{$driver_uid}' - LIMIT 1 - "); - $row = mysqli_fetch_assoc($qr); - - if(!$row){ - $fail('select_date', 'no install data'); - } - - $install_date = $row['di_install_date']; - qry("START TRANSACTION"); foreach($orderList as $item){ @@ -2249,8 +2245,8 @@ trait InstallAPI { UPDATE tbl_daily_install SET di_order_seq = '{$seq}' WHERE di_uid = '{$di_uid}' - AND di_driver_uid = '{$driver_uid}' - AND di_status = 'A' + AND di_driver_uid = '{$driver_uid}' + AND di_status = 'A' LIMIT 1 "; diff --git a/public_html/assets/css/main.css b/public_html/assets/css/main.css index b00cd72..62df5f0 100644 --- a/public_html/assets/css/main.css +++ b/public_html/assets/css/main.css @@ -2383,3 +2383,9 @@ tr.status-X { border-radius: 0 0 5px 5px; } } + +.tooltip-inner { + text-align: left; + max-width: 300px; + white-space: normal; +} diff --git a/public_html/doc/install_order.php b/public_html/doc/install_order.php index e33e3a4..28fb7e5 100644 --- a/public_html/doc/install_order.php +++ b/public_html/doc/install_order.php @@ -421,6 +421,7 @@ let installData = =json_encode($installData)?>; let driverInitialMap = =json_encode($driverInitialMap)?>; let reorderModeDriverUid = null; let reorderSelectedRow = null; // currently selected for reorder +const selectedDate = "= $selectedDate ?>"; document.addEventListener("DOMContentLoaded", function () { renderList(); @@ -1697,6 +1698,7 @@ function saveDriverOrder(driverUid){ api('daily_install_reorder', { driver_uid: driverUid, + install_date: selectedDate, order_list: JSON.stringify(orderList) }, (res) => { diff --git a/public_html/doc/install_wait_list.php b/public_html/doc/install_wait_list.php index 8432175..41d21c9 100644 --- a/public_html/doc/install_wait_list.php +++ b/public_html/doc/install_wait_list.php @@ -1285,6 +1285,16 @@ function formatPhone($phone) {