From b3a72eef38e51cb024b23e1a8e8e36ff72360c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Wed, 21 Aug 2024 09:20:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=BE=9C=E6=B5=B7=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=B1=89=E7=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trainsystem/controllers/api.php | 24 +++++++++++++++ .../trainsystem/models/BIZ_train_model.php | 30 ++++++++++++++++++- .../trainsystem/views/export_lanhai.php | 14 +++++---- 3 files changed, 62 insertions(+), 6 deletions(-) diff --git a/application/third_party/trainsystem/controllers/api.php b/application/third_party/trainsystem/controllers/api.php index 2356894e..e6a2e17f 100644 --- a/application/third_party/trainsystem/controllers/api.php +++ b/application/third_party/trainsystem/controllers/api.php @@ -422,11 +422,13 @@ class api extends CI_Controller{ $from_date = $this->input->post("from_date"); $to_date = $this->input->post("to_date"); $examine = $this->input->post("examine"); + $importht = $this->input->post("importht"); $reback=array();//返回的数据 $reback["from_date"] = $from_date; $reback["to_date"] = $to_date; $reback["examine"] = $examine; + $reback["importht"] = $importht; if(!empty($from_date) && !empty($to_date)){ //拼接发送的报文 @@ -457,6 +459,12 @@ class api extends CI_Controller{ $string_r = "";//输出 $arr = array();//整合完成的数组,写进excel表的数据 + + //账单导入到汉特。 先删除同一编码的数据,防止重复 + if (!empty($importht)){ + $BillSn = date('Ymd',strtotime($from_date)).date('Ymd',strtotime($to_date)); //这是获取开始结束日期作为编码,一定要和下面获取代码一样。 + $this->BIZ_train_model->del_lanhai_bill($BillSn); + } foreach ($ResponseData->data->records as $record) { # code... @@ -475,6 +483,22 @@ class api extends CI_Controller{ } $arr[] = $arrRecord; + + //账单导入到汉特。 + if (!empty($importht)){ + $AddHt_data = new stdClass(); //账单保存到汉特 + $AddHt_data->BillSn = date('Ymd',strtotime($from_date)).date('Ymd',strtotime($to_date)); + $AddHt_data->BillDate = $record->saveDay; + $AddHt_data->OrderId = $record->mainOrderId; + $AddHt_data->VEIName = LANHAI_appId; + $AddHt_data->From = "桂林海纳国际旅行社有限公司"; + $AddHt_data->BillType = $record->type; + $AddHt_data->OrderType = null; + $AddHt_data->Cost = -($record->price); + $AddHt_data->Memo = $record->handleTime; + //入库 + $this->BIZ_train_model->add_lanhai_bill($AddHt_data); + } } //print_r($arr); diff --git a/application/third_party/trainsystem/models/BIZ_train_model.php b/application/third_party/trainsystem/models/BIZ_train_model.php index 1113e56f..ae42485e 100644 --- a/application/third_party/trainsystem/models/BIZ_train_model.php +++ b/application/third_party/trainsystem/models/BIZ_train_model.php @@ -350,7 +350,7 @@ class BIZ_train_model extends CI_Model { ) or EXISTS(select Top 1 1 from InfoManager.dbo.trainsystem WHERE ts_cold_sn = COLD_SN and (ts_status = '5' or ts_status='11') and ts_cold_sn not in (select ts_cold_sn from InfoManager.dbo.trainsystem - where (ts_status='4' or ts_status='3' or ts_status='10') and ts_cold_sn = COLD_SN) )) + where (ts_status='4' or ts_status='3' or ts_status='2' or ts_status='10') and ts_cold_sn = COLD_SN) )) AND COLD_SN NOT IN ( select FOI_COLD_SN from BIZ_FlightsOrderInfo where FOI_COLD_SN=COLD_SN and FOI_TrainNetOrderNo>'') and (COLD_StartDate between GETDATE() and CONVERT(varchar(100),GETDATE()+14,23)+' 23:59') and isnull((select top 1 ts_autotimes from InfoManager.dbo.trainsystem where ts_cold_sn= bcld.cold_sn order by ts_id desc),0)<4 @@ -665,4 +665,32 @@ class BIZ_train_model extends CI_Model { $sql = "delete from trainsystem where ts_id = '860'"; $query = $this->INFO->query($sql); } + + //添加澜海账单到汉特 + function add_lanhai_bill($data){ + //2.添加 + $sql2 = "insert into BIZ_Platform_BookingInfo_XC ( + XC_BillSN,XC_BillDate,XC_OrderID,XC_VEIName,XC_From,XC_BillType,XC_Cost,XC_Memo,XC_Creator,XC_CreateDate + ) values ( + '{$data->BillSn}', + '{$data->BillDate}', + '{$data->OrderId}', + '{$data->VEIName}', + '{$data->From}', + '{$data->BillType}', + '{$data->Cost}', + '{$data->Memo}', + '29', + getdate() + )"; + $query = $this->HT->query($sql2); + } + + //删除重复数据 + function del_lanhai_bill($BillSn){ + //1.删除数据 ,防止重复,根据 XC_BillSn + $sql = "delete from BIZ_Platform_BookingInfo_XC where XC_BillSn = '{$BillSn}' and XC_VEIName='9082253783' "; + $query=$this->HT->query($sql); + + } } diff --git a/application/third_party/trainsystem/views/export_lanhai.php b/application/third_party/trainsystem/views/export_lanhai.php index 3ffc50a6..8da92eac 100644 --- a/application/third_party/trainsystem/views/export_lanhai.php +++ b/application/third_party/trainsystem/views/export_lanhai.php @@ -7,8 +7,12 @@
" autocomplete="off" placeholder="开始日期">  至   " autocomplete="off" placeholder="结束日期"> - 显示列表: name="examine" />    - + 显示列表: name="examine" />  |   + 导入汉特: name="importht" />      + +  

"> - + diff --git a/application/views/mobile_first/ch.php b/application/views/mobile_first/ch.php index 5578633e..9532b280 100644 --- a/application/views/mobile_first/ch.php +++ b/application/views/mobile_first/ch.php @@ -10,7 +10,7 @@ - + From 6271beef73bf07d11ee4ce6878ed52fd4315fb32 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Mon, 26 Aug 2024 15:37:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?15=20=E5=8F=B7=E6=B2=A1=E7=A5=A8=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/mobile_first/ah-lantern-form.php | 102 +++++++++--------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/application/views/mobile_first/ah-lantern-form.php b/application/views/mobile_first/ah-lantern-form.php index 7bb894cf..81462fee 100644 --- a/application/views/mobile_first/ah-lantern-form.php +++ b/application/views/mobile_first/ah-lantern-form.php @@ -6,14 +6,14 @@

Select Date:

- +
- + @@ -415,53 +415,59 @@ document.addEventListener('DOMContentLoaded', function () { - var premium_khomloy_left = document.getElementById("premium_khomloy_left"); - var vip_khomloy_left = document.getElementById("vip_khomloy_left"); - var standard_khomloy_left = document.getElementById("standard_khomloy_left"); - - var premium_khomloy_input = document.getElementById("premium_khomloy"); - var vip_khomloy_input = document.getElementById("vip_khomloy"); - var standard_khomloy_input = document.getElementById("standard_khomloy"); - - var ticket_date_november15th = document.getElementById("ticket_date_november15th"); - var ticket_date_november16th = document.getElementById("ticket_date_november16th"); - - vip_khomloy_input.checked = true; - - premium_khomloy_input.disabled = true; - vip_khomloy_input.disabled = false; - standard_khomloy_input.disabled = false; - - ticket_date_november15th.addEventListener('click', function () { - premium_khomloy_left.innerText ='Sold out' - vip_khomloy_left.innerText ='65 left' - standard_khomloy_left.innerText ='57 left' - - premium_khomloy_input.disabled = true; - vip_khomloy_input.disabled = false; - standard_khomloy_input.disabled = false; - - vip_khomloy_input.checked = true; - currentTicketPrice = parseInt(vip_khomloy_input.getAttribute('data-price')); - adultNumberValue = parseInt(adultNumberNode.value); - calcTotalPrice(currentTicketPrice, adultNumberValue); - }); - - ticket_date_november16th.addEventListener('click', function () { - premium_khomloy_left.innerText ='225 left' - vip_khomloy_left.innerText ='149 left' - standard_khomloy_left.innerText ='63 left' - - premium_khomloy_input.disabled = false; - vip_khomloy_input.disabled = false; - standard_khomloy_input.disabled = false; - - premium_khomloy_input.checked = true; - currentTicketPrice = parseInt(premium_khomloy_input.getAttribute('data-price')); - adultNumberValue = parseInt(adultNumberNode.value); - calcTotalPrice(currentTicketPrice, adultNumberValue); - }); + var premium_khomloy_left = document.getElementById("premium_khomloy_left"); + var vip_khomloy_left = document.getElementById("vip_khomloy_left"); + var standard_khomloy_left = document.getElementById("standard_khomloy_left"); + + var premium_khomloy_input = document.getElementById("premium_khomloy"); + var vip_khomloy_input = document.getElementById("vip_khomloy"); + var standard_khomloy_input = document.getElementById("standard_khomloy"); + + setNovember16thTicket(); + + // 15 号没票了 + ticket_date_november15th.addEventListener('click', function () { + // setNovember15thTicket(); + }); + + ticket_date_november16th.addEventListener('click', function () { + setNovember16thTicket(); }); + }); + + function setNovember15thTicket() { + premium_khomloy_left.innerText ='Sold out' + vip_khomloy_left.innerText ='Sold out' + standard_khomloy_left.innerText ='Sold out' + + premium_khomloy_input.disabled = true; + vip_khomloy_input.disabled = true; + standard_khomloy_input.disabled = true; + + // vip_khomloy_input.checked = true; + + currentTicketPrice = parseInt(vip_khomloy_input.getAttribute('data-price')); + adultNumberValue = parseInt(adultNumberNode.value); + calcTotalPrice(currentTicketPrice, adultNumberValue); + } + + function setNovember16thTicket() { + premium_khomloy_left.innerText ='225 left' + vip_khomloy_left.innerText ='149 left' + standard_khomloy_left.innerText ='63 left' + + premium_khomloy_input.disabled = false; + vip_khomloy_input.disabled = false; + standard_khomloy_input.disabled = false; + + premium_khomloy_input.checked = true; + vip_khomloy_input.checked = true; + standard_khomloy_input.checked = true; + + currentTicketPrice = parseInt(premium_khomloy_input.getAttribute('data-price')); + adultNumberValue = parseInt(adultNumberNode.value); + calcTotalPrice(currentTicketPrice, adultNumberValue); + } var venueList = document.querySelectorAll("input[name='Venue']"); From e7ad46e8c3779d888474afcfaa0780598c1571ed Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Mon, 26 Aug 2024 15:41:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?16=20=E9=BB=98=E8=AE=A4=E9=80=89=E6=8B=A9?= =?UTF-8?q?=20P=20=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/mobile_first/ah-lantern-form.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/application/views/mobile_first/ah-lantern-form.php b/application/views/mobile_first/ah-lantern-form.php index 81462fee..f3dbd66f 100644 --- a/application/views/mobile_first/ah-lantern-form.php +++ b/application/views/mobile_first/ah-lantern-form.php @@ -23,7 +23,7 @@

Select a Ticket Type:

- +