From 233ff82e2de8f96447137dcf5955b45d1e1f404e Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 9 Sep 2019 17:58:22 +0800 Subject: [PATCH 01/28] =?UTF-8?q?feat:=20iPaylinks=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E8=AE=B0=E5=BD=95=E5=BD=95=E5=85=A5=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F,=20=E4=B8=BA=E4=BA=86=E8=A7=A3=E5=86=B3=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E6=B2=A1=E6=9C=89=E6=8E=A5=E6=94=B6=E5=88=B0?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E9=80=9A=E7=9F=A5=E6=97=B6=E7=9A=84=E7=B4=A7?= =?UTF-8?q?=E6=80=A5=E8=AE=A2=E5=8D=95=E5=BD=95=E5=85=A5.=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E6=83=85=E5=86=B5=E4=B8=8D=E4=BD=BF=E7=94=A8=E6=AD=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/report.php | 126 ++++++++++++++++--- 1 file changed, 108 insertions(+), 18 deletions(-) diff --git a/webht/third_party/pay/controllers/report.php b/webht/third_party/pay/controllers/report.php index 2a99cc1b..9b3d8202 100644 --- a/webht/third_party/pay/controllers/report.php +++ b/webht/third_party/pay/controllers/report.php @@ -168,6 +168,7 @@ class Report extends CI_Controller public function ipaylinks_excel() { $this->load->model('IPayLinks_model'); + $this->load->model('Note_model'); set_time_limit(0); // 解析excel $target_folder = $this->input->get_post("f"); @@ -175,6 +176,9 @@ class Report extends CI_Controller log_message('error','ipaylinks excel POST: ' . $target_folder . $this->input->get_post("fjson")); $statement_folder = FCPATH.'download_statement\statement_files\\' . $target_folder; if ( ! is_dir($statement_folder)) { + + log_message('error','is not dir' . $statement_folder); + return; } $files = $files ? $files : array_values(array_diff(scandir($statement_folder), array('.', '..'))); @@ -195,6 +199,7 @@ class Report extends CI_Controller continue; } $settlement_record = $this->read_ipaylinks_excel($file_path); + if (empty($settlement_record)) { continue; } @@ -208,24 +213,40 @@ class Report extends CI_Controller $old_info = $this->IPayLinks_model->get_money_t(trim($settle['pn_invoice'])); } } - $warrant["PR_AccreditNo"] = trim($settle['pn_invoice']); - $warrant["PR_payType"] = 15018; - $warrant["PR_entryCurrency"] = trim($settle['entry_currency']); - $warrant["PR_entryAmount"] = bcadd(floatval($settle['entry_security']), floatval($settle['entry_basic'])); - $warrant["PR_COLI_SN"] = !empty($old_info) ? $old_info[0]->GAI_COLI_SN : NULL; - $warrant["PR_currency"] = trim($settle['currency']); - $warrant["PR_amount"] = trim($settle['order_amount']); - $warrant["PR_orderType"] = $orderid_info ? $orderid_info->ordertype : NULL; - $warrant["PR_fee"] = bcadd(trim($settle['service_fee']), trim($settle['transaction_fee'])); - $warrant["PR_paymentTime"] = trim($settle['complete_date']); - $warrant["PR_dealType"] = trim($settle['data_type']); - $warrant["PR_orderId"] = trim($settle['orderid']); - $warrant["PR_rate"] = trim($settle['settlement_rate']); - $warrant["PR_status"] = ""; - $warrant["PR_buyerName"] = ""; - $warrant["PR_buyerEmail"] = ""; - $this->Report_model->new_report($warrant); - $warrant = NULL; + $this->Note_model->save_ipl( + strval(trim($settle['pn_invoice'])) + ,strval(trim($settle['orderid'])) + ,strval(trim($settle['currency'])) + ,strval($settle['payment_type'])=="消费" ? strval(trim($settle['order_amount'])) : "-".$settle['order_amount'] + ,NULL + ,NULL + ,strval(trim($settle['complete_date'])) + ,strval(trim($settle['complete_date'])) + ,json_encode($settle) + ,strval($settle['payment_type'])=="消费" ? "pay" : "refund" + ,"0000" + ,"" + ,strval(substr($settle["payer"],0,49)) + ,strval($settle["email"]) + ); + // $warrant["PR_AccreditNo"] = trim($settle['pn_invoice']); + // $warrant["PR_payType"] = 15018; + // $warrant["PR_entryCurrency"] = trim($settle['entry_currency']); + // $warrant["PR_entryAmount"] = bcadd(floatval($settle['entry_security']), floatval($settle['entry_basic'])); + // $warrant["PR_COLI_SN"] = !empty($old_info) ? $old_info[0]->GAI_COLI_SN : NULL; + // $warrant["PR_currency"] = trim($settle['currency']); + // $warrant["PR_amount"] = trim($settle['order_amount']); + // $warrant["PR_orderType"] = $orderid_info ? $orderid_info->ordertype : NULL; + // $warrant["PR_fee"] = bcadd(trim($settle['service_fee']), trim($settle['transaction_fee'])); + // $warrant["PR_paymentTime"] = trim($settle['complete_date']); + // $warrant["PR_dealType"] = trim($settle['data_type']); + // $warrant["PR_orderId"] = trim($settle['orderid']); + // $warrant["PR_rate"] = trim($settle['settlement_rate']); + // $warrant["PR_status"] = ""; + // $warrant["PR_buyerName"] = ""; + // $warrant["PR_buyerEmail"] = ""; + // $this->Report_model->new_report($warrant); + // $warrant = NULL; $update_cnt++; } $settlement_record = null; // reset @@ -260,6 +281,60 @@ class Report extends CI_Controller /**取得最大的列号*/ $allColumn = $currentSheet->getHighestColumn(); + /**取得一共有多少行*/ + $allRow = $currentSheet->getHighestRow(); + $col_titles = $this->ipaylinks_col_title(); + /**从第二行开始输出,因为excel表中第一行为列名*/ + for($currentRow = 2;$currentRow <= $allRow;$currentRow++){ + $row_tmp = array(); + /**从第A列开始输出*/ + for($currentColumn= 'A';$currentColumn<= "Z"; $currentColumn++){ + /**ord()将字符转为十进制数*/ + $val = trim($currentSheet->getCellByColumnAndRow(ord($currentColumn) - 65,$currentRow)->getValue()); + if ( ! isset($col_titles[$currentColumn])) { + continue; + } + $col_mean = $col_titles[$currentColumn]; + if($col_mean == 'data_type' && in_array($val, $this->ipaylinks_noStore_dealType()) ) // strcasecmp('清算', $val) !== 0 + { + break; + } + if ($col_mean == 'orderid' && strcasecmp('-', $val) === 0) { + break; + } + $row_tmp[$col_mean] = $val; + } + if ($row_tmp['payment_type']!='消费') { + $row_tmp['orderid']=$row_tmp['raw_order']; + } + if (isset($row_tmp['order_amount'])) { + $tarr1[] = $row_tmp; + } + } + return $tarr1; + } + + public function read_ipaylinks_excel2($filePath) + { + $tarr1=array(); + $this->load->library('PHPExcel'); + $PHPExcel = new PHPExcel(); + /**默认用excel2007读取excel,若格式不对,则用之前的版本进行读取*/ + $PHPReader = new PHPExcel_Reader_Excel2007(); + if(!$PHPReader->canRead($filePath)){ + $PHPReader = new PHPExcel_Reader_Excel5(); + if(!$PHPReader->canRead($filePath)){ + echo 'no Excel'; + return ; + } + } + $PHPExcel = $PHPReader->load($filePath); + /**读取excel文件中的第一个工作表*/ + $currentSheet = $PHPExcel->getSheet(0); + + /**取得最大的列号*/ + $allColumn = $currentSheet->getHighestColumn(); + /**取得一共有多少行*/ $allRow = $currentSheet->getHighestRow(); $col_titles = $this->ipaylinks_col_title(); @@ -287,6 +362,21 @@ class Report extends CI_Controller return $tarr1; } public function ipaylinks_col_title() + { + return array( + "A" => "orderid", + "B" => "pn_invoice", + "C" => "complete_date", + "D" => "require_date", + "E" => "currency", + "F" => "order_amount", + "H" => "payer", + "M" => "raw_order", + "N" => "payment_type", + "R" => "email" + ); + } + public function ipaylinks_col_title2() { return array( "A" => "complete_date", From d24f215a3938aa8e2890a82a64a3835a23d3ad71 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 9 Sep 2019 18:00:27 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=89=88=E6=9C=AC:=20?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E7=89=88=E6=9C=AC=E4=BB=85=E5=81=9A?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=8A=9F=E8=83=BD=E7=9A=84=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/report.php | 126 +++---------------- 1 file changed, 18 insertions(+), 108 deletions(-) diff --git a/webht/third_party/pay/controllers/report.php b/webht/third_party/pay/controllers/report.php index 9b3d8202..2a99cc1b 100644 --- a/webht/third_party/pay/controllers/report.php +++ b/webht/third_party/pay/controllers/report.php @@ -168,7 +168,6 @@ class Report extends CI_Controller public function ipaylinks_excel() { $this->load->model('IPayLinks_model'); - $this->load->model('Note_model'); set_time_limit(0); // 解析excel $target_folder = $this->input->get_post("f"); @@ -176,9 +175,6 @@ class Report extends CI_Controller log_message('error','ipaylinks excel POST: ' . $target_folder . $this->input->get_post("fjson")); $statement_folder = FCPATH.'download_statement\statement_files\\' . $target_folder; if ( ! is_dir($statement_folder)) { - - log_message('error','is not dir' . $statement_folder); - return; } $files = $files ? $files : array_values(array_diff(scandir($statement_folder), array('.', '..'))); @@ -199,7 +195,6 @@ class Report extends CI_Controller continue; } $settlement_record = $this->read_ipaylinks_excel($file_path); - if (empty($settlement_record)) { continue; } @@ -213,40 +208,24 @@ class Report extends CI_Controller $old_info = $this->IPayLinks_model->get_money_t(trim($settle['pn_invoice'])); } } - $this->Note_model->save_ipl( - strval(trim($settle['pn_invoice'])) - ,strval(trim($settle['orderid'])) - ,strval(trim($settle['currency'])) - ,strval($settle['payment_type'])=="消费" ? strval(trim($settle['order_amount'])) : "-".$settle['order_amount'] - ,NULL - ,NULL - ,strval(trim($settle['complete_date'])) - ,strval(trim($settle['complete_date'])) - ,json_encode($settle) - ,strval($settle['payment_type'])=="消费" ? "pay" : "refund" - ,"0000" - ,"" - ,strval(substr($settle["payer"],0,49)) - ,strval($settle["email"]) - ); - // $warrant["PR_AccreditNo"] = trim($settle['pn_invoice']); - // $warrant["PR_payType"] = 15018; - // $warrant["PR_entryCurrency"] = trim($settle['entry_currency']); - // $warrant["PR_entryAmount"] = bcadd(floatval($settle['entry_security']), floatval($settle['entry_basic'])); - // $warrant["PR_COLI_SN"] = !empty($old_info) ? $old_info[0]->GAI_COLI_SN : NULL; - // $warrant["PR_currency"] = trim($settle['currency']); - // $warrant["PR_amount"] = trim($settle['order_amount']); - // $warrant["PR_orderType"] = $orderid_info ? $orderid_info->ordertype : NULL; - // $warrant["PR_fee"] = bcadd(trim($settle['service_fee']), trim($settle['transaction_fee'])); - // $warrant["PR_paymentTime"] = trim($settle['complete_date']); - // $warrant["PR_dealType"] = trim($settle['data_type']); - // $warrant["PR_orderId"] = trim($settle['orderid']); - // $warrant["PR_rate"] = trim($settle['settlement_rate']); - // $warrant["PR_status"] = ""; - // $warrant["PR_buyerName"] = ""; - // $warrant["PR_buyerEmail"] = ""; - // $this->Report_model->new_report($warrant); - // $warrant = NULL; + $warrant["PR_AccreditNo"] = trim($settle['pn_invoice']); + $warrant["PR_payType"] = 15018; + $warrant["PR_entryCurrency"] = trim($settle['entry_currency']); + $warrant["PR_entryAmount"] = bcadd(floatval($settle['entry_security']), floatval($settle['entry_basic'])); + $warrant["PR_COLI_SN"] = !empty($old_info) ? $old_info[0]->GAI_COLI_SN : NULL; + $warrant["PR_currency"] = trim($settle['currency']); + $warrant["PR_amount"] = trim($settle['order_amount']); + $warrant["PR_orderType"] = $orderid_info ? $orderid_info->ordertype : NULL; + $warrant["PR_fee"] = bcadd(trim($settle['service_fee']), trim($settle['transaction_fee'])); + $warrant["PR_paymentTime"] = trim($settle['complete_date']); + $warrant["PR_dealType"] = trim($settle['data_type']); + $warrant["PR_orderId"] = trim($settle['orderid']); + $warrant["PR_rate"] = trim($settle['settlement_rate']); + $warrant["PR_status"] = ""; + $warrant["PR_buyerName"] = ""; + $warrant["PR_buyerEmail"] = ""; + $this->Report_model->new_report($warrant); + $warrant = NULL; $update_cnt++; } $settlement_record = null; // reset @@ -281,60 +260,6 @@ class Report extends CI_Controller /**取得最大的列号*/ $allColumn = $currentSheet->getHighestColumn(); - /**取得一共有多少行*/ - $allRow = $currentSheet->getHighestRow(); - $col_titles = $this->ipaylinks_col_title(); - /**从第二行开始输出,因为excel表中第一行为列名*/ - for($currentRow = 2;$currentRow <= $allRow;$currentRow++){ - $row_tmp = array(); - /**从第A列开始输出*/ - for($currentColumn= 'A';$currentColumn<= "Z"; $currentColumn++){ - /**ord()将字符转为十进制数*/ - $val = trim($currentSheet->getCellByColumnAndRow(ord($currentColumn) - 65,$currentRow)->getValue()); - if ( ! isset($col_titles[$currentColumn])) { - continue; - } - $col_mean = $col_titles[$currentColumn]; - if($col_mean == 'data_type' && in_array($val, $this->ipaylinks_noStore_dealType()) ) // strcasecmp('清算', $val) !== 0 - { - break; - } - if ($col_mean == 'orderid' && strcasecmp('-', $val) === 0) { - break; - } - $row_tmp[$col_mean] = $val; - } - if ($row_tmp['payment_type']!='消费') { - $row_tmp['orderid']=$row_tmp['raw_order']; - } - if (isset($row_tmp['order_amount'])) { - $tarr1[] = $row_tmp; - } - } - return $tarr1; - } - - public function read_ipaylinks_excel2($filePath) - { - $tarr1=array(); - $this->load->library('PHPExcel'); - $PHPExcel = new PHPExcel(); - /**默认用excel2007读取excel,若格式不对,则用之前的版本进行读取*/ - $PHPReader = new PHPExcel_Reader_Excel2007(); - if(!$PHPReader->canRead($filePath)){ - $PHPReader = new PHPExcel_Reader_Excel5(); - if(!$PHPReader->canRead($filePath)){ - echo 'no Excel'; - return ; - } - } - $PHPExcel = $PHPReader->load($filePath); - /**读取excel文件中的第一个工作表*/ - $currentSheet = $PHPExcel->getSheet(0); - - /**取得最大的列号*/ - $allColumn = $currentSheet->getHighestColumn(); - /**取得一共有多少行*/ $allRow = $currentSheet->getHighestRow(); $col_titles = $this->ipaylinks_col_title(); @@ -362,21 +287,6 @@ class Report extends CI_Controller return $tarr1; } public function ipaylinks_col_title() - { - return array( - "A" => "orderid", - "B" => "pn_invoice", - "C" => "complete_date", - "D" => "require_date", - "E" => "currency", - "F" => "order_amount", - "H" => "payer", - "M" => "raw_order", - "N" => "payment_type", - "R" => "email" - ); - } - public function ipaylinks_col_title2() { return array( "A" => "complete_date", From ac631e0da90742b8e4857bdb19a006b7fb62239a Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 11 Sep 2019 10:47:49 +0800 Subject: [PATCH 03/28] =?UTF-8?q?feat:=20Trippest=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8+=E6=80=BB=E6=94=B6=E5=85=A5=E5=B7=AE?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trippestOrderSync/controllers/vendor_money.php | 2 +- .../trippestOrderSync/models/vendor_money_model.php | 6 +++++- .../trippestOrderSync/views/order_report_precheck.php | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/vendor_money.php b/webht/third_party/trippestOrderSync/controllers/vendor_money.php index 7bde868e..cd4c2aee 100644 --- a/webht/third_party/trippestOrderSync/controllers/vendor_money.php +++ b/webht/third_party/trippestOrderSync/controllers/vendor_money.php @@ -30,7 +30,7 @@ class Vendor_money extends CI_Controller { return $this->settlement(); } $start_date = $date_range_arr[0][0]; - $end_date =$date_range_arr[0][1] . " 23:59:59"; + $end_date =$date_range_arr[0][1] . " 23:59"; if ($end_date == null) { $end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1); } diff --git a/webht/third_party/trippestOrderSync/models/vendor_money_model.php b/webht/third_party/trippestOrderSync/models/vendor_money_model.php index ecd06ac2..01c5196e 100644 --- a/webht/third_party/trippestOrderSync/models/vendor_money_model.php +++ b/webht/third_party/trippestOrderSync/models/vendor_money_model.php @@ -370,11 +370,13 @@ class Vendor_money_model extends CI_Model { then TLD_total_price-HT_agency_receipt else TLD_total_price-TLD_agency_receipt-HT_haina_receipt end as 'HT_receipt_err' --海纳收差额 (账单减HT)' + ,data_tmp.total_income-(round(HT_haina_receipt,1)+ ROUND(HT_agency_receipt,1)) as 'total_income_err' --'海纳收入差额' ,(select top 1 GCI_combineNo from groupcombineinfo where gci_gri_sn=data_tmp.GRI_SN) as combineNo ,* from ( select gri.GRI_Name, + ro.money total_income, (select isnull(SUM(cast(GCI_priceCNY as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN) as TLD_total_price, (select isnull(SUM(cast(GCI_agencyReceipt as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN) as TLD_agency_receipt, (select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN @@ -401,7 +403,7 @@ class Vendor_money_model extends CI_Model { where 1=1 --and CGI_ArriveDate BETWEEN '$start_date' and '$end_date' and exists ( - select 1 from OperatorInfo where OPI_DEI_SN=30 and OPI_SN=COLI_OPI_ID + select 1 from OperatorInfo where OPI_SN=COLI_OPI_ID and (OPI_DEI_SN=30 or OPI_SN=435) ) and ro.orderstats=1 and GRI_OrderType=227002 @@ -415,6 +417,8 @@ class Vendor_money_model extends CI_Model { where 1=1 -- 总团款不相等 and data_tmp.TLD_total_price-(HT_haina_receipt+HT_agency_receipt)<>0 + -- 总收入和实收不相等 + OR data_tmp.total_income-(round(HT_haina_receipt,1)+ ROUND(HT_agency_receipt,1))<>0 -- 地接代收不相等:同步 OR ( data_tmp.COLI_OPI_ID=435 and HT_haina_receipt<>0 and TLD_agency_receipt<>0 diff --git a/webht/third_party/trippestOrderSync/views/order_report_precheck.php b/webht/third_party/trippestOrderSync/views/order_report_precheck.php index 81d422e3..ab14e3a6 100644 --- a/webht/third_party/trippestOrderSync/views/order_report_precheck.php +++ b/webht/third_party/trippestOrderSync/views/order_report_precheck.php @@ -87,6 +87,10 @@ HT团号 拼团号 + + 总收入差额 +

= 财务表总收入 - 收款记录总额

+ 总团款差额

= 账单总团款 - ( HT收款 + HT代收 )

@@ -111,6 +115,7 @@ + From 0d208075e59918e7c51b271892b9d9e4e6a29879 Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 11 Sep 2019 14:59:18 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E6=9C=BA=E7=A5=A8=E5=87=BA=E7=A5=A8?= =?UTF-8?q?=E5=90=8E=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flightsystem/config/config.php | 21 +++ .../flightsystem/controllers/api.php | 72 ++++++++++ .../flightsystem/controllers/pages.php | 20 +++ .../flightsystem/helpers/tuniu_helper.php | 90 ++++++++++++ .../flightsystem/views/common/footer.php | 43 ++++++ .../flightsystem/views/common/header.php | 131 ++++++++++++++++++ .../flightsystem/views/homepage.php | 122 ++++++++++++++++ 7 files changed, 499 insertions(+) create mode 100644 application/third_party/flightsystem/config/config.php create mode 100644 application/third_party/flightsystem/controllers/api.php create mode 100644 application/third_party/flightsystem/controllers/pages.php create mode 100644 application/third_party/flightsystem/helpers/tuniu_helper.php create mode 100644 application/third_party/flightsystem/views/common/footer.php create mode 100644 application/third_party/flightsystem/views/common/header.php create mode 100644 application/third_party/flightsystem/views/homepage.php diff --git a/application/third_party/flightsystem/config/config.php b/application/third_party/flightsystem/config/config.php new file mode 100644 index 00000000..7c1c6d75 --- /dev/null +++ b/application/third_party/flightsystem/config/config.php @@ -0,0 +1,21 @@ +"", + "1"=>"ʧЧ", + "2"=>"֧", + "3"=>"֧Ʊ", + "4"=>"Ʊɹ", + "5"=>"Ʊʧ", + "6"=>"Ʊ", + "7"=>"г˿Ʊ(ǩ)ɹ", + "8"=>"˿Ʊʧ", + "e"=>"ݴύʧ" + ); \ No newline at end of file diff --git a/application/third_party/flightsystem/controllers/api.php b/application/third_party/flightsystem/controllers/api.php new file mode 100644 index 00000000..1a2bc665 --- /dev/null +++ b/application/third_party/flightsystem/controllers/api.php @@ -0,0 +1,72 @@ +load->helper('tuniu'); + } + + public function index(){ + + } + + public function searchForHt(){ + $departDate = $this->input->get_post('departDate'); + $departCode = $this->input->get_post('departCode'); + $arriveCode = $this->input->get_post('arriveCode'); + + if(empty($departDate) || empty($departCode) || empty($arriveCode)){ + exit('请传入正确的参数,如有疑问请联系CYC!!!'); + } + + $url = 'https://www.trainspread.com/guide.php/flight/search/?departDate='.$departDate.'&departCode='.$departCode.'&arriveCode='.$arriveCode; + $json = post_tuniu($url); + $data['data'] = json_decode($json); + + $this->load->view('searchForHt',$data); + } + + public function addorders(){ + //接收参数 + $departime = $this->input->get_post('departime'); + $fromcode = $this->input->get_post('fromcode'); + $tocode = $this->input->get_post('tocode'); + $flightnumber = $this->input->get_post('flightnumber'); + + //测试数据 + $deparTime = '2019-08-15'; + $fromCode = 'BJS'; + $toCode = 'SHA'; + $flightNumber = 'KN5955'; + + //查询到sessionid + $searchJson = get_serach_json($deparTime,$fromCode,$toCode,$flightNumber); + $returnJson = post_tuniu(TUNIU_FLIGHT_API,$searchJson,'POST'); + $returnData = json_decode($returnJson); + $sessionId = $returnData->data->queryResultList['0']->resourceList['0']->sessionId; + //$sessionId = 'eyJuYW1lIjoiZGlzdE5ldyIsImZrIjoiTkFZI1NIQSNLTjU5NTUjMjAxOS0wOC0xNSIsInNpIjo4LCJjYSI6IlkiLCJjbyI6IkgiLCJhcCI6IjUxOCIsImNwIjoiNzcyIn0'; + echo $sessionId; + + //获取航班信息,订单信息 + + + //拼接下单报文 + $data = '{"contactTel":"18877381547","flight":{"adtPrice":1111,"arriveCityCode":"SHA","cabinClass":"Y","cabinCode":"H","departureCityCode":"BJS","departureDate":"2019-08-15","flightNum":"KN5955"},"remark":"haina123456","sessionId":"'.$sessionId.'","touristList":[{"birthday":"1992-08-13","firstName":"chen","lastName":"yuchao","name":"陈宇超","personType":"ADT","psptId":"450302199208131039","psptType":1,"tel":"18877381547"}]}'; + $timestamp = time(); + $sign = md5(TUNIU_FLIGHT_KEY.$data.$timestamp); + $bookJson = '{ + "purchaseId": '.TUNIU_FLIGHT_ID.', + "sign": "'.$sign .'", + "timestamp": '.$timestamp.', + "function": "createOrder", + "data":'.$data.' + }'; + //echo $bookJson;die(); + $returnJson = post_tuniu(TUNIU_FLIGHT_API,$bookJson,'POST'); + //print_r($returnData); + echo $returnJson; + //生成报文 + } +} \ No newline at end of file diff --git a/application/third_party/flightsystem/controllers/pages.php b/application/third_party/flightsystem/controllers/pages.php new file mode 100644 index 00000000..3479c6c4 --- /dev/null +++ b/application/third_party/flightsystem/controllers/pages.php @@ -0,0 +1,20 @@ +load->helper('tuniu'); + } + + public function index(){ + exit('ǰܣ'); + } + + public function homepage(){ + $this->load->view('common/header'); + $this->load->view('homepage'); + $this->load->view('common/footer'); + } +} \ No newline at end of file diff --git a/application/third_party/flightsystem/helpers/tuniu_helper.php b/application/third_party/flightsystem/helpers/tuniu_helper.php new file mode 100644 index 00000000..264ecac7 --- /dev/null +++ b/application/third_party/flightsystem/helpers/tuniu_helper.php @@ -0,0 +1,90 @@ += 99){ + return '有'; + }else{ + return $num; + } + } + } + } + + //获取毫秒数 + function get_microtime (){ + list($s1, $s2) = explode(' ', microtime()); + return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); + } + + //获取飞机查询报文 + function get_serach_json($departime,$fromcode,$tocode,$flightnumber=null){ + $timestamp = time(); + $function = 'queryNew'; + $flightnumberstr = ''; + if(!empty($flightnumber)){ + $flightnumberstr = ',"flightNum":"'.$flightnumber.'"'; + } + + $data = '{"channelId":7,"departureDate":"'.$departime.'","dstCityCode":"'.$tocode.'"'.$flightnumberstr.',"orgCityCode":"'.$fromcode.'"}'; + $sign = md5(TUNIU_FLIGHT_KEY.$data.$timestamp); + + $postJson = '{ + "purchaseId": '.TUNIU_FLIGHT_ID.', + "sign": "'.$sign .'", + "timestamp": '.$timestamp.', + "function": "'.$function.'", + "data":'.$data.' + }'; + + return $postJson; + } + + //发送请求函数 + function post_tuniu($url, $data = '', $method = 'GET') { + $curl = curl_init(); // 启动一个CURL会话 + curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址 + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查 + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在 + curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器 + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转 + curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer + if ($method == 'POST' && !empty($data)) { + curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求 + curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包 + curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); + } + curl_setopt($curl, CURLOPT_TIMEOUT, 40); // 设置超时限制防止死循环 + curl_setopt($curl, CURLOPT_TIMEOUT_MS, 40000); // 设置超时限制防止死循环 + curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容 + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回 + $tmpInfo = curl_exec($curl); // 执行操作 + $errno = curl_errno($curl); + if ($errno !== 0) { + return false; + echo $errno . curl_error($curl); //记录错误日志 + } + curl_close($curl); //关闭CURL会话 + return $tmpInfo; //返回数据 + } + +?> \ No newline at end of file diff --git a/application/third_party/flightsystem/views/common/footer.php b/application/third_party/flightsystem/views/common/footer.php new file mode 100644 index 00000000..b231b902 --- /dev/null +++ b/application/third_party/flightsystem/views/common/footer.php @@ -0,0 +1,43 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/third_party/flightsystem/views/common/header.php b/application/third_party/flightsystem/views/common/header.php new file mode 100644 index 00000000..57025d13 --- /dev/null +++ b/application/third_party/flightsystem/views/common/header.php @@ -0,0 +1,131 @@ + + + + + 出票系统 + + + + + + + \ No newline at end of file diff --git a/application/third_party/flightsystem/views/homepage.php b/application/third_party/flightsystem/views/homepage.php new file mode 100644 index 00000000..0163dcf1 --- /dev/null +++ b/application/third_party/flightsystem/views/homepage.php @@ -0,0 +1,122 @@ + +
+
+
+

翰特订单号 订单列表>>版本:V1.0

+
+
+
+ "> + +
+

外联:OPI_Name;}?>

+
+
+
+
+

飞机订单信息

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号航班号舱位出发城市抵达城市起飞日期起飞时间抵达时间票价是否提交过
1ZH1521经济舱(F)北京上海2019-10-3020:0023:30800
+ + + + + + + + + + + + + + + + + + + + + + + + +
序号姓名护照年龄类型
1陈宇超4564651635213246546成人
+ + +
+
+
+
+
From db5eea606d66bbb3f81a98b13ef7a77bf05269fc Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 11 Sep 2019 15:01:08 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E9=83=A8=E7=BD=B2=E7=80=9A=E7=89=B9?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E6=9C=BA=E7=A5=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flightsystem/views/searchForHt.php | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 application/third_party/flightsystem/views/searchForHt.php diff --git a/application/third_party/flightsystem/views/searchForHt.php b/application/third_party/flightsystem/views/searchForHt.php new file mode 100644 index 00000000..2a5ed55f --- /dev/null +++ b/application/third_party/flightsystem/views/searchForHt.php @@ -0,0 +1,73 @@ + + +
+
+

单程:queryResultList['0']->flight->departCityName.'-----'.$data->queryResultList['0']->flight->arriveCityName ?>

+
+
In the Morning (06 ~ 12)
+
In the Afternoon (12 ~ 18)
+
In the Evening (18 ~ 24)
+
All time
+
+ queryResultList as $items){ + echo '
'; + echo '

'.$items->flight->airlineCompany.'('.$items->flight->flightNo.')

'; + echo '
'.$items->flight->departTime.'
'; + echo '
'.$items->flight->arriveTime.'
'; + echo '
'.$items->flight->meal.'
'; + echo '
'.$items->resourceList['0']->price->adultPrice.'
'; + echo ''; + echo '
'; + echo '
'; + foreach ($items->resourceList as $seatItems){ + echo '
'; + echo '
'.$seatItems->cabinList['0']->cabinClassName.'('.$seatItems->cabinList['0']->cabinClass.')
'; + echo '
免费托运行李额:'.$seatItems->cabinList['0']->freeLuggage.$seatItems->cabinList['0']->freeLuggageUnit.'
'; + echo '
成人价:'.$seatItems->price->adultFacePrice.'
'; + echo '
儿童价:'.$seatItems->price->childPrice.'
'; + echo '
余票数:'.$seatItems->cabinList['0']->seatStatus.'
'; + echo '
'; + echo '
'; + } + echo '
'; + + } + + ?> +
+
+ From 161a3c77030b8ad9835250112f30c6d23c939f20 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 12 Sep 2019 15:26:31 +0800 Subject: [PATCH 06/28] =?UTF-8?q?feat:=20Trippest:=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=AE=A1=E6=A0=B8=E8=B4=A6=E5=8D=95,?= =?UTF-8?q?=E6=B1=87=E6=80=BB=E8=A1=A8=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/TulanduoApi.php | 3 + .../controllers/vendor_money.php | 118 ++++++++++++----- .../models/vendor_money_model.php | 57 +++++++- .../views/order_report_precheck.php | 52 +++++++- .../views/vendor_money_sum.php | 124 ++++++++++++------ 5 files changed, 274 insertions(+), 80 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php index 57019c3b..77c2344d 100644 --- a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php +++ b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php @@ -95,6 +95,9 @@ class TulanduoApi extends CI_Controller if ( ! empty($order_number)) { $this->tld_order->setAgcOrderNo($order_number); } else { + if (date('i') == '00') { + return; + } $get_type = rand(0, 1); // 需要按预定时间和出发时间, 避免有漏的 if ($get_type === 0) { log_message('error','Got order list From TuLanDuo By travel Date' ); diff --git a/webht/third_party/trippestOrderSync/controllers/vendor_money.php b/webht/third_party/trippestOrderSync/controllers/vendor_money.php index cd4c2aee..e9e2198b 100644 --- a/webht/third_party/trippestOrderSync/controllers/vendor_money.php +++ b/webht/third_party/trippestOrderSync/controllers/vendor_money.php @@ -65,9 +65,22 @@ class Vendor_money extends CI_Controller { ,"sum_payout" => 0 ,"sum_other" => 0 ), - "vendor" => array( + // "vendor" => array( + // "sum_trippest_cost" => 0 + // ,"sum_vendor_cost" => 0 + // ,"sum_trippest_sum" => 0 + // ,"sum_vendor_sum" => 0 + // ,"sum_profit" => 0 + // ,"sum_trippest_profit" => 0 + // ,"sum_vendor_profit" => 0 + // ,"sum_payout" => 0 + // ,"sum_other" => 0 + // ), + "sync" => array( "sum_trippest_cost" => 0 ,"sum_vendor_cost" => 0 + ,"sum_cost_sum" => 0 + ,"sum_price_sum" => 0 ,"sum_trippest_sum" => 0 ,"sum_vendor_sum" => 0 ,"sum_profit" => 0 @@ -80,6 +93,12 @@ class Vendor_money extends CI_Controller { ); $result['trippest_order_multi_city'] = array_merge($result['trippest_order_multi_city'], $this->money_model->trippest_order_multi_city($start_date, $end_date, implode(',', $vendors))); $result['trippest_order_cost_debug'] = $this->money_model->cost_debug_detail($start_date, $end_date, implode(',', $vendors)); + /** + * 计算同步回来的数据 + */ + $all_price_cost = $this->money_model->get_sync_price_cost($start_date, $end_date, implode(',', $vendors)); + $unique_sync_groupno = array(); + $dumplicate_groupno = array(); /** 团款 */ foreach ($vendors as $key => $vendor) { $sourcetype = $vendor_sourcetype[strval($vendor)]["sourcetype"]; @@ -93,8 +112,19 @@ class Vendor_money extends CI_Controller { "other_sum" => 0, "other_vendor_sum" => 0 ), - "vendor" => + // "vendor" => + // array( + // "trippest_sum" => 0, + // "vendor_sum" => 0, + // "transfer_sum" => 0, + // "other_sum_cost" => 0, + // "other_sum" => 0, + // "other_vendor_sum" => 0 + // ), + "sync" => array( + "price_sum" => 0, + "cost_sum" => 0, "trippest_sum" => 0, "vendor_sum" => 0, "transfer_sum" => 0, @@ -116,24 +146,35 @@ class Vendor_money extends CI_Controller { $ret["trippest"]['trippest_sum'] = bcsub($ret["trippest"]['trippest_sum'], $opi_money['other_price_sum']); $ret['trippest']['other_vendor_sum'] = bcadd($ret['trippest']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']); } - // 按照图兰朵算法: Trippest自营订单的代收算在海纳收款 - foreach ($opi_summoney as $kv => $opi_money_v) { - if (strval($opi_money_v['COLI_OPI_ID']) === '435') { - $ret["vendor"]['vendor_sum'] = bcadd(floatval($ret["vendor"]['vendor_sum']), floatval($opi_money_v['vendor_sum'])) ; - } else { - $ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['trippest_sum'])) ; - $ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['vendor_sum'])) ; + foreach ($all_price_cost as $ks => $sync) { + if ($sync['vendor_code'] != $vendor || in_array($sync['GCI_combineNo'],$unique_sync_groupno)) { + $dumplicate_groupno[] = $sync; + continue; } - $ret['vendor']['other_sum'] = bcadd($ret['vendor']['other_sum'], $opi_money_v['other_price_sum']); - $ret['vendor']['other_sum_cost'] = bcadd($ret['vendor']['other_sum_cost'], $opi_money_v['other_cost_sum']); - $ret["vendor"]['trippest_sum'] = bcsub($ret["vendor"]['trippest_sum'], $opi_money_v['other_price_sum']); - $ret['vendor']['other_vendor_sum'] = bcadd($ret['vendor']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']); - } - $ret["vendor"]["transfer_sum"] = bcsub($ret["vendor"]['vendor_sum'], $ret["trippest"]['vendor_sum']); - if ($ret["vendor"]["transfer_sum"] != 0) { - $result['transfer_sum'] = bcadd($result['transfer_sum'], $ret["vendor"]["transfer_sum"]); - $result['trippest_order_vendor_money'] = array_merge($result['trippest_order_vendor_money'], $this->money_model->trippest_order_with_vendormoney($vendor, $sourcetype, $start_date, $end_date)); + $unique_sync_groupno[] = $sync['GCI_combineNo']; + $ret['sync']['price_sum'] = bcadd($ret['sync']['price_sum'], $sync['receive_price']); + $ret['sync']['cost_sum'] = bcadd($ret['sync']['cost_sum'], $sync['cost']); + // $ret['sync']['vendor_sum'] = bcadd(floatval($ret["sync"]['vendor_sum']), floatval($sync['agency_receive_price'])) ; + // $ret["sync"]['trippest_sum'] = bcadd(floatval($ret["sync"]['trippest_sum']), bcsub(floatval($sync['receive_price']),floatval($sync['agency_receive_price']))) ; } + // 按照图兰朵算法: Trippest自营订单的代收算在海纳收款 + // foreach ($opi_summoney as $kv => $opi_money_v) { + // if (strval($opi_money_v['COLI_OPI_ID']) === '435') { + // $ret["vendor"]['vendor_sum'] = bcadd(floatval($ret["vendor"]['vendor_sum']), floatval($opi_money_v['vendor_sum'])) ; + // } else { + // $ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['trippest_sum'])) ; + // $ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['vendor_sum'])) ; + // } + // $ret['vendor']['other_sum'] = bcadd($ret['vendor']['other_sum'], $opi_money_v['other_price_sum']); + // $ret['vendor']['other_sum_cost'] = bcadd($ret['vendor']['other_sum_cost'], $opi_money_v['other_cost_sum']); + // $ret["vendor"]['trippest_sum'] = bcsub($ret["vendor"]['trippest_sum'], $opi_money_v['other_price_sum']); + // $ret['vendor']['other_vendor_sum'] = bcadd($ret['vendor']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']); + // } + // $ret["vendor"]["transfer_sum"] = bcsub($ret["vendor"]['vendor_sum'], $ret["trippest"]['vendor_sum']); + // if ($ret["vendor"]["transfer_sum"] != 0) { + // $result['transfer_sum'] = bcadd($result['transfer_sum'], $ret["vendor"]["transfer_sum"]); + // $result['trippest_order_vendor_money'] = array_merge($result['trippest_order_vendor_money'], $this->money_model->trippest_order_with_vendormoney($vendor, $sourcetype, $start_date, $end_date)); + // } $result["money"][strval($vendor)] = $ret; $result["money"][strval($vendor)]["vendor_code"] = $vendor; @@ -145,11 +186,16 @@ class Vendor_money extends CI_Controller { $result['col_sum']['trippest']['sum_vendor_sum'] = bcadd($result['col_sum']['trippest']['sum_vendor_sum'], $ret["trippest"]['vendor_sum']); $result['col_sum']['trippest']['sum_other'] = bcadd($result['col_sum']['trippest']['sum_other'], $ret['trippest']['other_sum']); - $result['col_sum']['vendor']['sum_trippest_sum'] = bcadd( - bcadd($result['col_sum']['vendor']['sum_trippest_sum'], $ret["vendor"]['trippest_sum']) - ,$ret['vendor']['other_sum']); - $result['col_sum']['vendor']['sum_vendor_sum'] = bcadd($result['col_sum']['vendor']['sum_vendor_sum'], $ret["vendor"]['vendor_sum']); - $result['col_sum']['vendor']['sum_other'] = bcadd($result['col_sum']['vendor']['sum_other'], $ret['vendor']['other_sum']); + $result['col_sum']['sync']['sum_price_sum'] = bcadd($result['col_sum']['sync']['sum_price_sum'], $ret["sync"]['price_sum']); + $result['col_sum']['sync']['sum_cost_sum'] = bcadd($result['col_sum']['sync']['sum_cost_sum'], $ret["sync"]['cost_sum']); + // $result['col_sum']['sync']['sum_trippest_sum'] = bcadd($result['col_sum']['sync']['sum_trippest_sum'], $ret["sync"]['trippest_sum']); + // $result['col_sum']['sync']['sum_vendor_sum'] = bcadd($result['col_sum']['sync']['sum_vendor_sum'],$ret['sync']['vendor_sum']); + + // $result['col_sum']['vendor']['sum_trippest_sum'] = bcadd( + // bcadd($result['col_sum']['vendor']['sum_trippest_sum'], $ret["vendor"]['trippest_sum']) + // ,$ret['vendor']['other_sum']); + // $result['col_sum']['vendor']['sum_vendor_sum'] = bcadd($result['col_sum']['vendor']['sum_vendor_sum'], $ret["vendor"]['vendor_sum']); + // $result['col_sum']['vendor']['sum_other'] = bcadd($result['col_sum']['vendor']['sum_other'], $ret['vendor']['other_sum']); } /** 成本 */ $vendors_cost = $this->money_model->vendor_cost(implode(',', $vendors), $start_date, $end_date); @@ -171,29 +217,29 @@ class Vendor_money extends CI_Controller { $vmi['trippest']['total_profit'] = bcsub( bcadd(bcadd($vmi['trippest']['trippest_sum'], $vmi['trippest']['vendor_sum']),$vmi['trippest']['other_sum']), bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['trippest']['other_sum_cost'])); - $vmi['vendor']['total_profit'] = bcsub( - bcadd(bcadd($vmi['vendor']['trippest_sum'], $vmi['vendor']['vendor_sum']),$vmi['vendor']['other_sum']), - bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['vendor']['other_sum_cost'])); + // $vmi['vendor']['total_profit'] = bcsub( + // bcadd(bcadd($vmi['vendor']['trippest_sum'], $vmi['vendor']['vendor_sum']),$vmi['vendor']['other_sum']), + // bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['vendor']['other_sum_cost'])); /** 利润分成 */ $vmi['trippest']['vendor_profit'] = bcmul($vmi['trippest']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]); $vmi['trippest']['trippest_profit'] = bcmul($vmi['trippest']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) ); - $vmi['vendor']['vendor_profit'] = bcmul($vmi['vendor']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]); - $vmi['vendor']['trippest_profit'] = bcmul($vmi['vendor']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) ); + // $vmi['vendor']['vendor_profit'] = bcmul($vmi['vendor']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]); + // $vmi['vendor']['trippest_profit'] = bcmul($vmi['vendor']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) ); /** Trippest应付地接 */ $vmi['trippest']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['trippest']['vendor_profit'] ), $vmi['trippest']['vendor_sum']); - $vmi['vendor']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['vendor']['vendor_profit'] ), $vmi['vendor']['vendor_sum']); + // $vmi['vendor']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['vendor']['vendor_profit'] ), $vmi['vendor']['vendor_sum']); /** 利润总计 */ $result['col_sum']['trippest']['sum_profit'] = bcadd($result['col_sum']['trippest']['sum_profit'], $vmi['trippest']['total_profit']); $result['col_sum']['trippest']['sum_trippest_profit'] = bcadd($result['col_sum']['trippest']['sum_trippest_profit'], $vmi['trippest']['trippest_profit']); $result['col_sum']['trippest']['sum_vendor_profit'] = bcadd($result['col_sum']['trippest']['sum_vendor_profit'], $vmi['trippest']['vendor_profit']); - $result['col_sum']['vendor']['sum_profit'] = bcadd($result['col_sum']['vendor']['sum_profit'], $vmi['vendor']['total_profit']); - $result['col_sum']['vendor']['sum_trippest_profit'] = bcadd($result['col_sum']['vendor']['sum_trippest_profit'], $vmi['vendor']['trippest_profit']); - $result['col_sum']['vendor']['sum_vendor_profit'] = bcadd($result['col_sum']['vendor']['sum_vendor_profit'], $vmi['vendor']['vendor_profit']); + // $result['col_sum']['vendor']['sum_profit'] = bcadd($result['col_sum']['vendor']['sum_profit'], $vmi['vendor']['total_profit']); + // $result['col_sum']['vendor']['sum_trippest_profit'] = bcadd($result['col_sum']['vendor']['sum_trippest_profit'], $vmi['vendor']['trippest_profit']); + // $result['col_sum']['vendor']['sum_vendor_profit'] = bcadd($result['col_sum']['vendor']['sum_vendor_profit'], $vmi['vendor']['vendor_profit']); /** 应付总计 */ $result['col_sum']['trippest']['sum_payout'] = bcadd($result['col_sum']['trippest']['sum_payout'], $vmi['trippest']['payout']); - $result['col_sum']['vendor']['sum_payout'] = bcadd($result['col_sum']['vendor']['sum_payout'], $vmi['vendor']['payout']); + // $result['col_sum']['vendor']['sum_payout'] = bcadd($result['col_sum']['vendor']['sum_payout'], $vmi['vendor']['payout']); } $this->load->view('vendor_money_sum', $result); return ; @@ -272,9 +318,9 @@ class Vendor_money extends CI_Controller { return $this->settlement(); } $start_date = $date_range_arr[0][0]; - $end_date =$date_range_arr[0][1] . " 23:59:59"; + $end_date =$date_range_arr[0][1] . " 23:59"; if ($end_date == null) { - $end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1); + $end_date = date("Y-m-d H:i", strtotime("+1 month", strtotime($start_date))-1); } $ret['default_date1'] = $start_date; $ret['default_date2'] = $end_date; @@ -283,6 +329,8 @@ class Vendor_money extends CI_Controller { $vendor_sourcetype = $this->trippest->vendor_sourcetype(); // price [Trippest receipts & agency receipts] $ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors)); + // not found in GroupCombineInfo + $ret['not_found'] = $this->money_model->get_order_not_found_gci($start_date, $end_date, implode(',' ,$vendors)); // cost $HT_combine_cost = $this->money_model->get_combine_cost($start_date, $end_date, implode(',' ,$vendors)); $cost_error = array(); diff --git a/webht/third_party/trippestOrderSync/models/vendor_money_model.php b/webht/third_party/trippestOrderSync/models/vendor_money_model.php index 01c5196e..b1866ed0 100644 --- a/webht/third_party/trippestOrderSync/models/vendor_money_model.php +++ b/webht/third_party/trippestOrderSync/models/vendor_money_model.php @@ -381,7 +381,7 @@ class Vendor_money_model extends CI_Model { (select isnull(SUM(cast(GCI_agencyReceipt as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN) as TLD_agency_receipt, (select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN and GAI_Type in (" . PAY_OTHER . ") - and GAI_VEI_SN in ($all_vendor) + AND GAI_VEI_SN in ($all_vendor,1343) -- 图兰朵的代收 and DeleteFlag=0 ) as HT_agency_receipt, (select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN @@ -399,6 +399,7 @@ class Vendor_money_model extends CI_Model { --CK_GroupInfo cgi inner join GRoupInfo gri --on CGI_GRI_SN=GRI_SN inner join BIZ_ConfirmLineInfo coli on COLI_GRI_SN=GRI_SN + and COLI_State not in (50) inner join report_order ro on ro.ordernumber=COLI_ID where 1=1 --and CGI_ArriveDate BETWEEN '$start_date' and '$end_date' @@ -443,6 +444,60 @@ class Vendor_money_model extends CI_Model { return $query->result_array(); } + public function get_order_not_found_gci($start_date, $end_date, $all_vendor) + { + $sql = "SELECT * + from BIZ_ConfirmLineInfo coli + inner join GRoupInfo gri on gri.GRI_SN=COLI_GRI_SN + where COLI_OPI_ID=435 and ISNULL(COLI_SenderIP,'')='' + and not exists ( + select 1 from GroupCombineInfo where GCI_GRI_SN=GRI_SN + ) + and exists ( + select 1 from BIZ_ConfirmLineDetail where COLD_COLI_SN=COLI_SN + and COLD_PlanVEI_SN in ($all_vendor) + and COLD_StartDate between '$start_date' and '$end_date' + ) + and isnull(coli.DeleteFlag,0)=0 + and COLI_IsSuccess=1 + order by COLI_ApplyDate desc"; + $query = $this->HT->query($sql); + return $query->result_array(); + } + + public function get_sync_price_cost($start_date, $end_date, $all_vendor) + { + $sql = "SELECT group_cost.GCI_VEI_SN vendor_code, + GCI_combineNo, + (SELECT isnull(SUM(CONVERT(float, isnull(gcod.GCOD_sumMoney,0))),0) + FROM GroupCombineOperationDetail gcod + WHERE gcod.GCOD_GCI_combineNo=GCI_combineNo + AND gcod.GCOD_operationType<> 'otherReceives' + ) AS cost + ,(select SUM(CONVERT(float, GCI_priceCNY)) from GroupCombineInfo where GCI_combineNo=group_cost.GCI_combineNo + ) as receive_price + ,(select SUM(CONVERT(float, GCI_agencyReceipt)) from GroupCombineInfo where GCI_combineNo=group_cost.GCI_combineNo + ) as agency_receive_price + FROM + (SELECT isnull(gci.GCI_combineNo,'1') GCI_combineNo + ,GCI_VEI_SN + FROM GroupCombineInfo gci + WHERE 1=1 + AND GCI_VEI_SN IN ($all_vendor) + AND EXISTS + ( SELECT 1 + FROM CK_GroupInfo + WHERE CGI_Checked=1 + AND CGI_GRI_SN=GCI_GRI_SN + AND CGI_ArriveDate BETWEEN '$start_date' AND '$end_date') + group by isnull(gci.GCI_combineNo,'1') + ,GCI_VEI_SN + ) AS group_cost + order by GCI_combineNo desc"; + $query = $this->HT->query($sql); + return $query->result_array(); + } + } /* End of file vendor_money.php */ diff --git a/webht/third_party/trippestOrderSync/views/order_report_precheck.php b/webht/third_party/trippestOrderSync/views/order_report_precheck.php index ab14e3a6..d3b9198c 100644 --- a/webht/third_party/trippestOrderSync/views/order_report_precheck.php +++ b/webht/third_party/trippestOrderSync/views/order_report_precheck.php @@ -78,11 +78,10 @@

- - + @@ -111,7 +110,18 @@ $ep) { ?> + $col_sum = array( + "sum_total_income" => 0 + ,"sum_total_price" => 0 + ,"sum_agency_receipt" => 0 + ,"sum_HT_receipt" => 0 + ); + foreach ($price_error as $ko => $ep) { + $col_sum['sum_total_income'] = bcadd($col_sum['sum_total_income'], $ep['total_income_err']); + $col_sum['sum_total_price'] = bcadd($col_sum['sum_total_price'], $ep['total_price_err']); + $col_sum['sum_agency_receipt'] = bcadd($col_sum['sum_agency_receipt'], $ep['agency_receipt_err']); + $col_sum['sum_HT_receipt'] = bcadd($col_sum['sum_HT_receipt'], $ep['HT_receipt_err']); + ?> @@ -127,10 +137,33 @@ - + + + + + + + + + + +
团款异常:团款异常:
HT团号
合计
+

+ + + + + + + + + $vn) { ?> + + +
未找到同步的数据,需检查是否在账单中存在
+

@@ -158,7 +191,11 @@ $ht) { ?> + foreach ($ht_no_match as $ko => $ht) { + if ($ht['cost'] == 0) { + continue; + } + ?> @@ -167,7 +204,8 @@ $xls) { ?> + foreach ($xls_no_match as $ko => $xls) { + ?> 未找到 diff --git a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php index 45ed8b27..6164a9ce 100644 --- a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php +++ b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php @@ -79,7 +79,7 @@ 目的地 - 总营收 + 总营收 总成本 ⑤利润 ⑥海纳利润 @@ -89,8 +89,9 @@ ①海纳代收 ②地接代收 - ③海纳成本 - ④地接成本 + ①+② + ③海纳成本 + ④地接成本 @@ -103,6 +104,7 @@ + @@ -146,9 +148,10 @@ - 合计(仅包价产品) + 合计(仅包价产品) + @@ -206,6 +209,53 @@ + +

同步数据:

+ + + + + + + + + + + + + + + $sync) { + ?> + + + + + + + + + + + + + + + + + + + + + + +
目的地总营收:①海纳代收+②地接代收总成本:③海纳成本+④地接成本⑤利润⑥海纳利润⑦地接利润⑧海纳应付地接
合计
From 16bdae5534b064ef99055a91c7d6a9199556de50 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 12 Sep 2019 15:34:56 +0800 Subject: [PATCH 07/28] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trippestOrderSync/views/vendor_money_sum.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php index 6164a9ce..d83388e4 100644 --- a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php +++ b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php @@ -148,7 +148,7 @@ - 合计(仅包价产品) + 合计(仅包价产品) @@ -168,7 +168,7 @@ 总报价/USD 总收款/RMB 计入上表海纳收团款 - 应扣除的其他地接收款: (实时计算, 存在汇率误差) + 应扣除的其他地接收款: (实时计算, 存在汇率误差) $order) { ?> @@ -180,13 +180,13 @@
- + - + 成本异常,建议重新审核: 订单号 @@ -194,7 +194,7 @@ 拼团人等 订单: 成人数 + 儿童数 订单成本 - 财务表备注 + 财务表备注 $order) { ?> @@ -204,7 +204,7 @@ + - + @@ -244,6 +244,8 @@ + 合计 @@ -254,6 +256,7 @@ + - - + > + > From 894eedd4e9aa6364af32a9656e6fa035d1c43143 Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 18 Sep 2019 10:34:14 +0800 Subject: [PATCH 14/28] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=BA=E7=A8=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/trainsystem/controllers/callback.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/third_party/trainsystem/controllers/callback.php b/application/third_party/trainsystem/controllers/callback.php index ba077dae..a2de5501 100644 --- a/application/third_party/trainsystem/controllers/callback.php +++ b/application/third_party/trainsystem/controllers/callback.php @@ -262,6 +262,7 @@ class callback extends CI_Controller{ $data_passager->ticketprice = $tickets_item->OrderTicketPrice; $data_passager->seatype = $tickets_item->OrderTicketSeat; $data_passager->seatdetail = $ticket_item2->SeatNo; + $data_passager->TOC_VEI_SN = 28209; $this->train_system_model->add_passagers($data_passager); } }else{ @@ -272,6 +273,7 @@ class callback extends CI_Controller{ $data_passager->ticketprice = $tickets_item->OrderTicketPrice; $data_passager->seatype = $tickets_item->OrderTicketSeat; $data_passager->seatdetail = $tickets_item->DetailInfos->DetailInfo->SeatNo; + $data_passager->TOC_VEI_SN = 28209; $this->train_system_model->add_passagers($data_passager); } } @@ -287,6 +289,7 @@ class callback extends CI_Controller{ $data_passager->ticketprice = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketPrice; $data_passager->seatype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketSeat; $data_passager->seatdetail = $items->SeatNo; + $data_passager->TOC_VEI_SN = 28209; $this->train_system_model->add_passagers($data_passager); } } @@ -301,6 +304,7 @@ class callback extends CI_Controller{ $data_passager->ticketprice = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketPrice; $data_passager->seatype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketSeat; $data_passager->seatdetail = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->SeatNo; + $data_passager->TOC_VEI_SN = 28209; $this->train_system_model->add_passagers($data_passager); } From 734a6b9c7f4c836e0b49741b8b108ba91eca9371 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 18 Sep 2019 10:51:58 +0800 Subject: [PATCH 15/28] =?UTF-8?q?fix:=20PayPal=E7=8A=B6=E6=80=81=3Dcomplet?= =?UTF-8?q?ed=E7=9A=84=E6=89=80=E6=9C=89=E9=80=80=E6=AC=BE=E8=A1=8C?= =?UTF-8?q?=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/paypal/controllers/index.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 924398b9..1e7dd6d6 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -829,7 +829,7 @@ class Index extends CI_Controller { } //退款状态默认为已经处理,陆燕在退款前手动通知外联了,系统跳过处理 - if (strtolower($item->pn_payment_status) == 'refunded') { + if (strtolower($item->pn_payment_status) == 'refunded' ) { $this->send_refund($item, $handpick, $old_ssje); // $this->Note_model->update_send($item->pn_txn_id, 'send'); continue; @@ -846,6 +846,12 @@ class Index extends CI_Controller { continue; } + // 状态=已完成 退款行为:撤销付款/拒付等 + if (floatval($item->pn_mc_gross) < 0) { + $this->send_refund($item, $handpick, $old_ssje); + continue; + } + //根据note信息找到订单号 $get_order_no = $item->pn_invoice; $orderid_info = $this->analysis_orderid($item->pn_invoice); From eb3befd8eb16ff556b2dfbc4ea4e469109168000 Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 18 Sep 2019 15:38:37 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flightsystem/views/searchForHt.php | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/application/third_party/flightsystem/views/searchForHt.php b/application/third_party/flightsystem/views/searchForHt.php index 2a5ed55f..38bbe091 100644 --- a/application/third_party/flightsystem/views/searchForHt.php +++ b/application/third_party/flightsystem/views/searchForHt.php @@ -11,23 +11,28 @@ queryResultList as $items){ - echo '
'; - echo '

'.$items->flight->airlineCompany.'('.$items->flight->flightNo.')

'; - echo '
'.$items->flight->departTime.'
'; - echo '
'.$items->flight->arriveTime.'
'; - echo '
'.$items->flight->meal.'
'; - echo '
'.$items->resourceList['0']->price->adultPrice.'
'; + echo '
'; + echo '

'.$items->flight->airlineCompany.' ('.$items->flight->flightNo.')

'; + echo '
'.$items->flight->departAirportName.' ('.$items->flight->departAirportTerminal.') '.$items->flight->departTime.'
'; + echo '
'.$items->flight->duration.':00
'; + echo '
'.$items->flight->arriveAirportName.' ('.$items->flight->arriveAirportTerminal.') '.$items->flight->arriveTime.'
'; + echo '
'.$items->flight->craftType.' ('.$items->flight->meal.')
'; + echo '
经济舱全价:
'; echo ''; echo '
'; echo '
'; foreach ($items->resourceList as $seatItems){ - echo '
'; + echo '
'; echo '
'.$seatItems->cabinList['0']->cabinClassName.'('.$seatItems->cabinList['0']->cabinClass.')
'; echo '
免费托运行李额:'.$seatItems->cabinList['0']->freeLuggage.$seatItems->cabinList['0']->freeLuggageUnit.'
'; - echo '
成人价:'.$seatItems->price->adultFacePrice.'
'; - echo '
儿童价:'.$seatItems->price->childPrice.'
'; + if($seatItems->price->adultFacePrice != $seatItems->price->cabinClassFullPrice){ + echo '
票面价(折扣):'.$seatItems->price->adultFacePrice.' ('.round(($seatItems->price->adultFacePrice / $seatItems->price->cabinClassFullPrice),2) *10 .')
'; + }else{ + echo '
票面价:'.$seatItems->price->adultFacePrice.'(全价)
'; + } + echo '
全价:'.$seatItems->price->cabinClassFullPrice.'
'; echo '
余票数:'.$seatItems->cabinList['0']->seatStatus.'
'; - echo '
'; + echo '
'; echo '
'; } echo '
'; @@ -69,5 +74,10 @@ $(function(){ $('#alltime').click(function(){ $('.flightItems').show(); }); + + $('.seatList').hover(function(){ + $('.seatList').css('background-color','#fff'); + $(this).css('background-color','#ccc'); + }); }); From d989c1a82cf2ec7f9be41b0eb6367b5f5f59afb3 Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 18 Sep 2019 15:51:51 +0800 Subject: [PATCH 17/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/flightsystem/views/searchForHt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/third_party/flightsystem/views/searchForHt.php b/application/third_party/flightsystem/views/searchForHt.php index 38bbe091..90980c95 100644 --- a/application/third_party/flightsystem/views/searchForHt.php +++ b/application/third_party/flightsystem/views/searchForHt.php @@ -17,7 +17,7 @@ echo '
'.$items->flight->duration.':00
'; echo '
'.$items->flight->arriveAirportName.' ('.$items->flight->arriveAirportTerminal.') '.$items->flight->arriveTime.'
'; echo '
'.$items->flight->craftType.' ('.$items->flight->meal.')
'; - echo '
经济舱全价:
'; + echo '
经济舱 '(.$items->resourceList['0']->price->cabinClassFullPrice.)' 全价:
'; echo ''; echo '
'; echo '
'; From 1b041479f79725079a904aacc73ec1b35b97e666 Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 18 Sep 2019 15:53:09 +0800 Subject: [PATCH 18/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/flightsystem/views/searchForHt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/third_party/flightsystem/views/searchForHt.php b/application/third_party/flightsystem/views/searchForHt.php index 90980c95..50deae78 100644 --- a/application/third_party/flightsystem/views/searchForHt.php +++ b/application/third_party/flightsystem/views/searchForHt.php @@ -17,7 +17,7 @@ echo '
'.$items->flight->duration.':00
'; echo '
'.$items->flight->arriveAirportName.' ('.$items->flight->arriveAirportTerminal.') '.$items->flight->arriveTime.'
'; echo '
'.$items->flight->craftType.' ('.$items->flight->meal.')
'; - echo '
经济舱 '(.$items->resourceList['0']->price->cabinClassFullPrice.)' 全价:
'; + echo '
经济舱 ('.$items->resourceList['0']->price->cabinClassFullPrice.') 全价:
'; echo ''; echo '
'; echo '
'; @@ -30,7 +30,7 @@ }else{ echo '
票面价:'.$seatItems->price->adultFacePrice.'(全价)
'; } - echo '
全价:'.$seatItems->price->cabinClassFullPrice.'
'; + //echo '
全价:'.$seatItems->price->cabinClassFullPrice.'
'; echo '
余票数:'.$seatItems->cabinList['0']->seatStatus.'
'; echo '
'; echo '
'; From 03d6a0dc78c909e369f82def243b9f2f5515538a Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 18 Sep 2019 15:57:38 +0800 Subject: [PATCH 19/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/flightsystem/views/searchForHt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/third_party/flightsystem/views/searchForHt.php b/application/third_party/flightsystem/views/searchForHt.php index 50deae78..e2a30da8 100644 --- a/application/third_party/flightsystem/views/searchForHt.php +++ b/application/third_party/flightsystem/views/searchForHt.php @@ -17,7 +17,7 @@ echo '
'.$items->flight->duration.':00
'; echo '
'.$items->flight->arriveAirportName.' ('.$items->flight->arriveAirportTerminal.') '.$items->flight->arriveTime.'
'; echo '
'.$items->flight->craftType.' ('.$items->flight->meal.')
'; - echo '
经济舱 ('.$items->resourceList['0']->price->cabinClassFullPrice.') 全价:
'; + echo '
经济舱 ('.$items->resourceList['0']->price->cabinClassFullPrice.') 全价:
'; echo ''; echo '
'; echo '
'; From eb7e1b35abe71478556c44ed570a7d2839357215 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 18 Sep 2019 22:40:50 +0800 Subject: [PATCH 20/28] =?UTF-8?q?fix:=20=E5=90=8C=E4=B8=AA=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=8B=BC=E5=A4=9A=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/vendor_money.php | 18 ++++++++++++++---- .../models/orderFinance_model.php | 16 ++++++++-------- .../models/vendor_money_model.php | 4 +++- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/vendor_money.php b/webht/third_party/trippestOrderSync/controllers/vendor_money.php index 9f6b10b7..e228647f 100644 --- a/webht/third_party/trippestOrderSync/controllers/vendor_money.php +++ b/webht/third_party/trippestOrderSync/controllers/vendor_money.php @@ -36,11 +36,24 @@ class Vendor_money extends CI_Controller { } $vendors = $this->input->post("vendors"); $vendor_sourcetype = $this->trippest->vendor_sourcetype(); + // 不同地接社但是拼团号相同 + $actual_vendor_duplicate_combineno = $this->money_model->get_duplicate_vei_combineno($start_date, $end_date, implode(",", $vendors)); + $duplicate_coli_sn = array_column($actual_vendor_duplicate_combineno, 'COLI_SN'); if ($download_vendor !== null) { $vendors = array($download_vendor); $sourcetype = $vendor_sourcetype[strval($download_vendor)]["sourcetype"]; $vendor_name = $vendor_sourcetype[strval($download_vendor)]["vendor_name"]; - $vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors)); + $vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors), implode(',', $duplicate_coli_sn)); + foreach ($actual_vendor_duplicate_combineno as $kad => $vad) { + if ($vad['vendor1'] == $download_vendor) { + $tmp['haina_income'] = $vad['trippest_sum']; + $tmp['vendor_income'] = $vad['vendor_sum']; + $tmp['GRI_No'] = $vad['gri_no']; + $tmp['group_vendor_cost'] = $vad['pure_cost']; + $vendor_data[] = $tmp; + $tmp = array(); + } + } $file_name = str_replace(" ", "_", $date_range) . "_" . $vendor_name; return $this->download_output($vendor_data, $file_name); } @@ -91,9 +104,6 @@ class Vendor_money extends CI_Controller { ) ) ); - // 不同地接社但是拼团号相同 - $actual_vendor_duplicate_combineno = $this->money_model->get_duplicate_vei_combineno($start_date, $end_date, implode(",", $vendors)); - $duplicate_coli_sn = array_column($actual_vendor_duplicate_combineno, 'COLI_SN'); $result['trippest_order_multi_city'] = array_merge($result['trippest_order_multi_city'], $this->money_model->trippest_order_multi_city($start_date, $end_date, implode(',', $vendors))); $result['trippest_order_cost_debug'] = $this->money_model->cost_debug_detail($start_date, $end_date, implode(',', $vendors)); /** diff --git a/webht/third_party/trippestOrderSync/models/orderFinance_model.php b/webht/third_party/trippestOrderSync/models/orderFinance_model.php index 9bf5260e..9a8949b7 100644 --- a/webht/third_party/trippestOrderSync/models/orderFinance_model.php +++ b/webht/third_party/trippestOrderSync/models/orderFinance_model.php @@ -271,13 +271,13 @@ class OrderFinance_model extends CI_Model { $tourBz_tmp = ""; if ($this->report_tour_exists($vrt['ordernumber'], $vrt['RPT_COLD_SN']) === TRUE) { $where = " ordernumber='" . $vrt['ordernumber'] . "' and RPT_COLD_SN=".$vrt['RPT_COLD_SN'] ; //AND tourCode='" . $vrt['tourCode'] . "' "; - // $tourBz_tmp = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($vrt['tourBZ'], ",", true)); - // if (stripos($tourBz_tmp, "pvt") === false) { - // $tourBz_tmp = str_replace("]", "", $tourBz_tmp); - // } - // $tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp); - // $where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%' - // OR tourBZ='') "; + $tourBz_tmp = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($vrt['tourBZ'], ",", true)); + if (stripos($tourBz_tmp, "pvt") === false) { + $tourBz_tmp = str_replace("]", "", $tourBz_tmp); + } + $tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp); + $where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%' + OR tourBZ='') "; $delete_sql = "DELETE FROM tourmanager.dbo.Report_Tour where " . $where; // $update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', $vrt, $where); $this->HT->query($delete_sql); @@ -391,7 +391,7 @@ class OrderFinance_model extends CI_Model { foreach ($other_tour_cost as $kotc => $votc) { if ($this->report_tour_exists($votc->ordernumber, $votc->RPT_COLD_SN) === TRUE) { $where = " ordernumber='" . $votc->ordernumber . "' AND RPT_COLD_SN=" . $votc->RPT_COLD_SN; - // $where .= " AND tourBZ='" . $votc->tourBZ . "' "; + $where .= " AND tourBZ='" . $votc->tourBZ . "' "; $update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', json_decode(json_encode($votc), TRUE), $where); $this->HT->query($update_sql); } else { diff --git a/webht/third_party/trippestOrderSync/models/vendor_money_model.php b/webht/third_party/trippestOrderSync/models/vendor_money_model.php index 1eea1770..063c4efd 100644 --- a/webht/third_party/trippestOrderSync/models/vendor_money_model.php +++ b/webht/third_party/trippestOrderSync/models/vendor_money_model.php @@ -229,7 +229,7 @@ class Vendor_money_model extends CI_Model { return $query->result_array(); } - public function group_detail_list($vendor, $sourcetype, $start_date, $end_date, $all_vendor) + public function group_detail_list($vendor, $sourcetype, $start_date, $end_date, $all_vendor, $duplicate_gri) { $sql = "SELECT (dbo.ConvertToRMB('USD',other_vendor_price)) as other_vendorprice_RMB, @@ -295,6 +295,7 @@ class Vendor_money_model extends CI_Model { ) and CGI_Checked=1 and GRI_OrderType=227002 + and COLI_SN not in ($duplicate_gri) and exists ( select 1 from BIZ_ConfirmLineDetail where COLD_COLI_SN=coli.COLI_SN and DeleteFlag=0 @@ -530,6 +531,7 @@ class Vendor_money_model extends CI_Model { inner join BIZ_ConfirmLineInfo c on COLI_GRI_SN=GCI_GRI_SN where g1.gci_combineno=vendor_group.GCI_combineNo ) as COLI_SN + ,(select top 1 GRI_No from groupInfo inner join groupcombineinfo gc on gc.GCI_GRI_SN=GRI_SN where gc.gci_combineno=vendor_group.GCI_combineNo) as gri_no ,(SELECT isnull(SUM(CONVERT(float, isnull(gcod.GCOD_sumMoney,0))),0) FROM GroupCombineOperationDetail gcod WHERE gcod.GCOD_GCI_combineNo=GCI_combineNo From 2ba826c8afb9ed19ffd4fc7eea61346ca68ef568 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 19 Sep 2019 11:35:16 +0800 Subject: [PATCH 21/28] =?UTF-8?q?feat:=20Trippest=E8=B4=A6=E5=8D=95:=20?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E8=A1=A8=E7=9A=84=E6=8B=BC=E5=9B=A2=E6=80=BB?= =?UTF-8?q?=E6=88=90=E6=9C=AC=E5=AF=B9=E6=AF=94=E5=AE=9E=E9=99=85=E6=8B=BC?= =?UTF-8?q?=E5=9B=A2=E6=80=BB=E6=88=90=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/vendor_money.php | 2 + .../models/vendor_money_model.php | 57 +++++++++++ .../views/vendor_money_sum.php | 97 ++++--------------- 3 files changed, 77 insertions(+), 79 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/vendor_money.php b/webht/third_party/trippestOrderSync/controllers/vendor_money.php index e228647f..f6f63be1 100644 --- a/webht/third_party/trippestOrderSync/controllers/vendor_money.php +++ b/webht/third_party/trippestOrderSync/controllers/vendor_money.php @@ -268,6 +268,8 @@ class Vendor_money extends CI_Controller { $result['col_sum']['trippest']['sum_payout'] = bcadd($result['col_sum']['trippest']['sum_payout'], $vmi['trippest']['payout']); // $result['col_sum']['vendor']['sum_payout'] = bcadd($result['col_sum']['vendor']['sum_payout'], $vmi['vendor']['payout']); } + // 财务表成本和实际成本不相等 + $result['diff_cost'] = $this->money_model->report_tour_diff($start_date, $end_date, implode(',', $vendors)); $this->load->view('vendor_money_sum', $result); return ; } diff --git a/webht/third_party/trippestOrderSync/models/vendor_money_model.php b/webht/third_party/trippestOrderSync/models/vendor_money_model.php index 063c4efd..a7e01d3f 100644 --- a/webht/third_party/trippestOrderSync/models/vendor_money_model.php +++ b/webht/third_party/trippestOrderSync/models/vendor_money_model.php @@ -556,6 +556,63 @@ class Vendor_money_model extends CI_Model { return $query->result_array(); } + public function report_tour_diff($start_date, $end_date, $all_vendor) + { + $sql = "SELECT * , + (SELECT top 1 RPT_Total + FROM report_tour + WHERE 1=1 + AND tourProvide=gci_vei_name + AND tourBZ LIKE '%'+REPLACE(gci_no,'[','[[]')+'%' + AND ( RPT_Total<>to_be_diff.report_total_cost0 + OR RPT_Total<>to_be_diff.total_cost ) ) AS diff_report_total_cost0 +FROM + (SELECT * , + (SELECT isnull(SUM(CONVERT(float,gcod.GCOD_sumMoney)),0) + FROM GroupCombineOperationDetail gcod + WHERE GCOD_GCI_combineNo=all_gci_no.gci_no + AND gcod.GCOD_operationType <> 'otherReceives' + AND GCOD_VEI_SN=all_gci_no.GCI_VEI_SN + ) AS total_cost , + (SELECT isnull(round(SUM(isnull(tourcost,0)),2),0) + FROM report_tour + WHERE 1=1 + AND tourProvide=gci_vei_name + AND tourBZ LIKE '%'+REPLACE(gci_no,'[','[[]')+'%' + ) AS report_cost , + (SELECT top 1 RPT_Total + FROM report_tour + WHERE 1=1 + AND tourProvide=gci_vei_name + AND tourBZ LIKE '%'+REPLACE(gci_no,'[','[[]')+'%' + ) AS report_total_cost0 + FROM ( select + CASE WHEN GCI_combineNo is NULL THEN 'nn' + WHEN GCI_combineNo='cancel' THEN CONVERT(varchar(50), 'nn') + ELSE GCI_combineNo END gci_no , + GCI_VEI_SN , + (SELECT VEI2_CompanyBN + FROM VEndorInfo2 + WHERE VEI2_VEI_SN=GCI_VEI_SN + AND VEI2_LGC=2 ) AS gci_vei_name + FROM GroupCombineInfo + WHERE GCI_travelDate + BETWEEN '$start_date' + AND '$end_date' + and GCI_VEI_SN in ($all_vendor) + and CHARINDEX('TA', GCI_combineNo ) = 0 + GROUP BY GCI_combineNo,GCI_VEI_SN + ) all_gci_no + ) AS to_be_diff +WHERE CONVERT(decimal(10,2),to_be_diff.report_cost) <> to_be_diff.report_total_cost0 + OR CONVERT(decimal(10,2),to_be_diff.total_cost) <> to_be_diff.report_total_cost0 + OR CONVERT(decimal(10,2),to_be_diff.total_cost) <> round(to_be_diff.report_cost,2) +ORDER BY to_be_diff.GCI_VEI_SN + "; + $query = $this->HT->query($sql); + return $query->result_array(); + } + } /* End of file vendor_money.php */ diff --git a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php index d83388e4..20f05663 100644 --- a/webht/third_party/trippestOrderSync/views/vendor_money_sum.php +++ b/webht/third_party/trippestOrderSync/views/vendor_money_sum.php @@ -259,88 +259,27 @@ - + +
From 71622c87b3db351f05d1afe5b548c5280d8240e5 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 19 Sep 2019 14:37:35 +0800 Subject: [PATCH 22/28] =?UTF-8?q?fix:=20WeChatPay=20=E9=A1=B5=E9=9D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/PaymentService.php | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index 5af49913..674c8270 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -32,27 +32,7 @@ class PaymentService extends CI_Controller { } else { $data['notelist'] = $this->note_model->search_date($data['date']); } - array_walk($data["notelist"], function(&$ele, $key) - { - $ele->brand_name = "none"; - switch ($ele->OPN_accountMethod) { - case '15016': - $ele->brand_name = "WeChat"; - break; - case '15010': - case '15002': - $ele->brand_name = "PayPal"; - break; - case '15018': - $ele->brand_name = "Credit Card"; - break; - case '15015': - $ele->brand_name = "Alipay"; - break; - default: - break; - } - }); + array_walk($data["notelist"], 'PaymentService::set_brandname'); /** * 导出记录用的记录节点 @@ -70,10 +50,33 @@ class PaymentService extends CI_Controller { $data = array(); $data['date'] = date('Y-m-d'); $data['notelist'] = $this->note_model->failnote(100); + array_walk($data["notelist"], 'PaymentService::set_brandname'); $this->load->view("payment_list",$data); return; } + public function set_brandname(&$ele) + { + $ele->brand_name = "none"; + switch ($ele->OPN_accountMethod) { + case '15016': + $ele->brand_name = "WeChat"; + break; + case '15010': + case '15002': + $ele->brand_name = "PayPal"; + break; + case '15018': + $ele->brand_name = "Credit Card"; + break; + case '15015': + $ele->brand_name = "Alipay"; + break; + default: + break; + } + } + public function send_notify($opn_id=NULL, $old_ssje=NULL) { ignore_user_abort(true); From ebfbc0ff3bf39698d4f4a90136d233243037d463 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 19 Sep 2019 14:50:53 +0800 Subject: [PATCH 23/28] fix: js jq v1.9+ mise error --- webht/third_party/pay/views/payment_list.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webht/third_party/pay/views/payment_list.php b/webht/third_party/pay/views/payment_list.php index b568e59e..37174b71 100644 --- a/webht/third_party/pay/views/payment_list.php +++ b/webht/third_party/pay/views/payment_list.php @@ -260,6 +260,15 @@