From d712319653d4bf6de89c33cdac27479b9d881298 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 2 Jan 2020 09:33:17 +0800 Subject: [PATCH 1/2] fix: report tour: tourProvider --- .../trippestOrderSync/controllers/order_finance.php | 8 +++++--- .../trippestOrderSync/models/orderFinance_model.php | 2 +- .../trippestOrderSync/models/vendor_money_model.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/order_finance.php b/webht/third_party/trippestOrderSync/controllers/order_finance.php index 961e6585..bef65b10 100644 --- a/webht/third_party/trippestOrderSync/controllers/order_finance.php +++ b/webht/third_party/trippestOrderSync/controllers/order_finance.php @@ -433,8 +433,9 @@ class Order_finance extends CI_Controller { } } $this_order_real_pag_sns = array_map(function($ele) {return $ele->real_pag_sn;}, $ret->order_cost); - $pags_info = $this->OrderFinance_model->get_pag_info(implode(',', array_unique(array_filter($this_order_real_pag_sns)))); // $pag_sns - $ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; + $pags_info = $this->OrderFinance_model->get_pag_info(implode(',', array_unique(array_filter($this_order_real_pag_sns))),$ret->order_cost[0]->vei_sn); // $pag_sns + $ret->vendor_name = implode(",", array_values(array_unique(array_filter( array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info))))) ; + // $ret->vendor_name = trim($ret->vendor_name); $ret->pag_name = implode("; ", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; $ret->PAG_Code = implode(",", $ret->combine_pags); $ret->comment = "拼团" . $combineNo . ", 按" . $ret->person_num . "人等"; @@ -504,7 +505,7 @@ class Order_finance extends CI_Controller { $pag_sns = array_values(array_unique(array_map(function($ele) {return $ele->COLD_ServiceSN;}, $all_orders))); $pags_info = $this->OrderFinance_model->get_pag_info(implode(',', $pag_sns), $all_orders[0]->COLD_PlanVEI_SN); $ret->PAG_Code = implode(",", array_values(array_unique(array_map(function($ele) {return mb_strtoupper($ele->PAG_Code);}, $pags_info)))); - $ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; + $ret->vendor_name = implode(",", array_values(array_unique(array_filter(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info))))) ; $ret->pag_name = implode("; ", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; if ($debug!=false) { return $this->output->set_content_type('application/json')->set_output(json_encode($ret)); @@ -564,6 +565,7 @@ class Order_finance extends CI_Controller { "BJALC-209", // "BJSIC-16", "SHSIC-45", + "SHSIC-57", "XASIC-16" ); } diff --git a/webht/third_party/trippestOrderSync/models/orderFinance_model.php b/webht/third_party/trippestOrderSync/models/orderFinance_model.php index 3def163e..11bec1f8 100644 --- a/webht/third_party/trippestOrderSync/models/orderFinance_model.php +++ b/webht/third_party/trippestOrderSync/models/orderFinance_model.php @@ -188,7 +188,7 @@ class OrderFinance_model extends CI_Model { if ($PAG_SN_str=="") { return array(); } - $vei_sql = $cold_vei===null ? 'PAG_DefaultVEI_SN' : "isnull(PAG_DefaultVEI_SN,$cold_vei)"; + $vei_sql = $cold_vei===null ? 'PAG_DefaultVEI_SN' : $cold_vei; $sql = "SELECT pag.PAG_SN,PAG_Code,PAG_DefaultVEI_SN,PAG_Title,vei2.VEI2_CompanyBN from BIZ_PackageInfo pag left join VEndorInfo2 vei2 on VEI2_VEI_SN=$vei_sql and VEI2_LGC=2 diff --git a/webht/third_party/trippestOrderSync/models/vendor_money_model.php b/webht/third_party/trippestOrderSync/models/vendor_money_model.php index 00d33cfd..9ab886f4 100644 --- a/webht/third_party/trippestOrderSync/models/vendor_money_model.php +++ b/webht/third_party/trippestOrderSync/models/vendor_money_model.php @@ -385,7 +385,7 @@ class Vendor_money_model extends CI_Model { public function get_precheck_price_error($start_date, $end_date, $all_vendor) { - $expire_fresh = date('Y-m-d',strtotime("+2 months", strtotime($start_date))); + $expire_fresh = date('Y-m-d',strtotime("+62 days", strtotime($start_date))); $sql = "SELECT data_tmp.TLD_total_price-(HT_haina_receipt+HT_agency_receipt) as 'total_price_err', --总团款差额 (账单减HT)', case data_tmp.COLI_OPI_ID when 435 From 80a397afcb21826270168558f8247994b80f73c3 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 7 Jan 2020 13:40:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20Trippest=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9A=84=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trippestOrderSync/controllers/TulanduoApi.php | 12 ++++++++++++ .../trippestOrderSync/models/orders_model.php | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php index 66811b34..b9df1c80 100644 --- a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php +++ b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php @@ -327,6 +327,18 @@ class TulanduoApi extends CI_Controller $getInfo_byGroupCode = $getInfo_byGroupCodeArr[0]; // 渠道和目的地有重复操作的团 $duplicate = true; } else { + $null_gci = array_map(function ($ele) { + if (intval($ele->COLI_OPI_ID)===435 && $ele->senderIP==='' + && $ele->gci===null + ) { + return $ele->COLI_ID; + } else { + return null; + } + }, $getInfo_byGroupCodeArr); + foreach (array_unique(array_filter($null_gci)) as $knull => $vnull) { + $this->order_cancel($vnull); + } foreach ($getInfo_byGroupCodeArr as $kg => $vg) { // 同步的订单, 修改了团号, 用地接社id匹配 if(intval($order->COLI_OPI_ID)===435 && $order->GCI_VendorOrderId == $vg->gci) { diff --git a/webht/third_party/trippestOrderSync/models/orders_model.php b/webht/third_party/trippestOrderSync/models/orders_model.php index 270d6f97..3deaaabe 100644 --- a/webht/third_party/trippestOrderSync/models/orders_model.php +++ b/webht/third_party/trippestOrderSync/models/orders_model.php @@ -593,12 +593,13 @@ class Orders_model extends CI_Model { */ public function get_order_by_groupcode($code, $order_id=0, $vei_sn=0) { - $vei_sn_sql = $vei_sn===0 ? " " : " AND COLD_PlanVEI_SN=$vei_sn "; + $vei_sn_sql = $vei_sn===0 ? " " : " AND isnull(COLD_PlanVEI_SN,1343) in (1343,$vei_sn) "; $sql = "SELECT COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID, (select top 1 case gci_vendororderId when $order_id then gci_vendororderId else 0 end from groupcombineinfo where gci_gri_sn=coli_gri_sn order by case gci_vendororderId when $order_id then 0 else 1 end asc ) as gci, + ISNULL(coli.COLI_SenderIP,'') senderIP, coli.COLI_OrderDetailText,coli.COLI_GroupCode,coli.COLI_GRI_SN, coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency GRI_OPI_ID,GRI_operator,GRI_No,GRI_Name,