From 263c4e97ba21ac602277a296d8b27125eb1d4f2f Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 27 Jun 2019 10:38:39 +0800 Subject: [PATCH 01/26] =?UTF-8?q?wxpay:=E4=B8=8B=E8=BD=BD=E8=B4=A6?= =?UTF-8?q?=E5=8D=95=E4=B9=8B=E5=90=8E=E5=8D=B3=E8=B0=83=E7=94=A8=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/PaymentService.php | 6 +- .../pay/controllers/WxpayService.php | 1 + .../pay/helpers/payment_helper.php | 107 ++++++++++++------ .../third_party/pay/libraries/wxpay_call.php | 1 + 4 files changed, 79 insertions(+), 36 deletions(-) diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index f75ef175..e1b190a9 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -56,6 +56,7 @@ class PaymentService extends CI_Controller { public function send_notify($opn_id=NULL, $old_ssje=NULL) { ignore_user_abort(true); + $output = "处理交易记录:
"; $data = array(); $show_index = 0; //优先处理指定的交易号,用于修正交易号直接发送通知 @@ -254,11 +255,12 @@ class PaymentService extends CI_Controller { //显示处理记录 if (empty($opn_id)) { - echo ++$show_index . ' ' . $item->OPN_transactionId . '
'; + $output .= (++$show_index) . ' ' . $item->OPN_transactionId . '
'; } } - return; + echo $output; + return $output; // return $this->output->set_content_type('application/json')->set_output(json_encode($data)); } diff --git a/webht/third_party/pay/controllers/WxpayService.php b/webht/third_party/pay/controllers/WxpayService.php index ff844983..0d67bc7a 100644 --- a/webht/third_party/pay/controllers/WxpayService.php +++ b/webht/third_party/pay/controllers/WxpayService.php @@ -91,6 +91,7 @@ class WxpayService extends CI_Controller { foreach ($all_account as $account) { $this->download_bill($account); } + async_curl("https://www.mycht.cn/webht.php/apps/pay/paymentservice/send_notify"); return; } diff --git a/webht/third_party/pay/helpers/payment_helper.php b/webht/third_party/pay/helpers/payment_helper.php index 27ff11e9..6eb7f5b7 100644 --- a/webht/third_party/pay/helpers/payment_helper.php +++ b/webht/third_party/pay/helpers/payment_helper.php @@ -1,17 +1,17 @@ $v) - { - $temp[$k] = explode(",",$v); //再将拆开的数组重新组装 - } - return $temp; + foreach ($array2D as $v) + { + $v = join(",",$v); //降维,也可以用implode,将一维数组转换为用逗号连接的字符串 + $temp[] = $v; + } + $temp = array_unique($temp); //去掉重复的字符串,也就是重复的一维数组 + foreach ($temp as $k => $v) + { + $temp[$k] = explode(",",$v); //再将拆开的数组重新组装 + } + return $temp; } function my_array_unique($array, $keep_key_assoc = false) @@ -39,30 +39,69 @@ function my_array_unique($array, $keep_key_assoc = false) //根据URL获取月份 function getaqiMonth($url){ - $monArr = array('January','February','March','April','May','June','July','August','September','October','November','December'); - $monObj = array( - 'January' => '01', - 'February' => '02', - 'March' => '03', - 'April' => '04', - 'May' => '05' , - 'June' => '06', - 'July' => '07', - 'August' => '08', - 'September' => '09', - 'October' => '10', - 'November' => '11', - 'December' => '12'); - $urlarr = explode("/",$url); - $tmp = $urlarr[(count($urlarr)-1)]; - $tmp = ucfirst(str_ireplace('.htm','',$tmp)); - //$d=strtotime("00:01am ".$tmp." 15 2015"); - if(in_array($tmp,$monArr)){ - return $monObj[$tmp]; - }else{ - return false; - } + $monArr = array('January','February','March','April','May','June','July','August','September','October','November','December'); + $monObj = array( + 'January' => '01', + 'February' => '02', + 'March' => '03', + 'April' => '04', + 'May' => '05' , + 'June' => '06', + 'July' => '07', + 'August' => '08', + 'September' => '09', + 'October' => '10', + 'November' => '11', + 'December' => '12'); + $urlarr = explode("/",$url); + $tmp = $urlarr[(count($urlarr)-1)]; + $tmp = ucfirst(str_ireplace('.htm','',$tmp)); + //$d=strtotime("00:01am ".$tmp." 15 2015"); + if(in_array($tmp,$monArr)){ + return $monObj[$tmp]; + }else{ + return false; + } } +/*! + * @Author: LYT + * @Date: 2019-06-27 10:32:11 + * @Desc: 异步的curl,1秒超时,被请求的地址需要设置: ignore_user_abort(true); + */ +function async_curl($url, $second = 1) +{ + $ch = curl_init(); + $curlVersion = curl_version(); + $ua = "Webht (".PHP_OS.") PHP/".PHP_VERSION." CURL/".$curlVersion['version']." " . "AsyncJob"; + //设置超时 + curl_setopt($ch, CURLOPT_TIMEOUT, $second); + curl_setopt($ch,CURLOPT_URL, $url); + if(stripos($url,"https://")!==FALSE){ + curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); + } else { + curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE); + curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);//严格校验 + } + curl_setopt($ch,CURLOPT_USERAGENT, $ua); + //设置header + curl_setopt($ch, CURLOPT_HEADER, FALSE); + //要求结果为字符串且输出到屏幕上 + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); + + //运行curl + $data = curl_exec($ch); + if (curl_errno($ch) && !in_array(curl_errno($ch),array(0,28)) ) { + log_message('error',"Webht Async Curl Call 出错,错误码:" . curl_errno($ch) . ": " . curl_error($ch) . ", url: " . $url); + } + if (!in_array(curl_getinfo($ch, CURLINFO_HTTP_CODE),array(0,200)) ) { + log_message('error', "Webht Async Curl Call Request html Status Code: ".curl_getinfo($ch, CURLINFO_HTTP_CODE)."; curl url: ".$url); + } + curl_close($ch); + return $data; +} + /* * 把数组元素组合为字符串 * $container:用来包含元素的符号 diff --git a/webht/third_party/pay/libraries/wxpay_call.php b/webht/third_party/pay/libraries/wxpay_call.php index f493e7f0..85f29fdd 100644 --- a/webht/third_party/pay/libraries/wxpay_call.php +++ b/webht/third_party/pay/libraries/wxpay_call.php @@ -164,6 +164,7 @@ class Wxpay_call log_message('error',"curl出错,错误码:$error " . curl_error($ch)); curl_close($ch); } + return; } From e249894196d74107f228f146c6bd914747263a95 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 27 Jun 2019 10:58:49 +0800 Subject: [PATCH 02/26] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=BA=E7=A8=8B?= =?UTF-8?q?=E5=87=BA=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trainsystem/controllers/addorders.php | 38 +++++++++++++++++-- .../tripadvisor_spider/controllers/index.php | 29 ++++++++++++++ .../models/Tripadvisor_Review_model.php | 16 ++++++++ 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/application/third_party/trainsystem/controllers/addorders.php b/application/third_party/trainsystem/controllers/addorders.php index 69a4ebcd..0ba6315e 100644 --- a/application/third_party/trainsystem/controllers/addorders.php +++ b/application/third_party/trainsystem/controllers/addorders.php @@ -648,7 +648,7 @@ class addorders extends CI_Controller{ $PostData['TrainOrderService']->Order->User->UserName = 'guilintravel'; $PostData['TrainOrderService']->Order->User->userLoginName = 'guilintravel'; $PostData['TrainOrderService']->Order->User->UserMobile = '18877381547'; - //print_r($PostData);die(); + //print_r(json_encode($PostData)); //本地添加记录 $add_data = new stdClass(); $add_data->cold_sn = $cold_sn; @@ -673,11 +673,11 @@ class addorders extends CI_Controller{ $this->train_system_model->add_orders($add_data); $Url = 'http://m.ctrip.com/restapi/soa2/11009/json/PartnerAddOrder'; - $ResponseJson = GetPost_http($Url,json_encode($PostData),'POST'); + $ResponseJson = GetPost_http($Url,json_encode($PostData),'json'); $ResponseData = json_decode($ResponseJson); //echo '预定'; - //print_r($ResponseData); + //print_r($ResponseData);die(); //预定请求成功后执行支付 if($ResponseData->Status == 'SUCCESS'){ @@ -693,4 +693,36 @@ class addorders extends CI_Controller{ } echo json_encode($reback); } + + //请求支付 + public function payorders($CtripOrder,$Price){ + if(empty($CtripOrder) && !is_numeric($Price)){ + exit('传参错误!'); + } + + //生成报文 + $PostData = array(); + $TimeStamp = time(); + $time = date('Y-m-d H:i:s',$TimeStamp); + $PostData['Authentication']->TimeStamp = $time; + $PostData['Authentication']->ServiceName = 'order.PartnerPayOrder'; + $PostData['Authentication']->PartnerName = ORDERUSER; + $MessageIdentity = md5($time.'order.PartnerPayOrder'.ORDERKEY); + $PostData['Authentication']->MessageIdentity = $MessageIdentity; + + $PostData['TrainOrderService']->PartnerName = ORDERUSER; + $PostData['TrainOrderService']->OrderNumber = $CtripOrder; + $PostData['TrainOrderService']->PayedPrice = $Price; + //$PostData['TrainOrderService']->PayType = $time; + //$PostData['TrainOrderService']->TradeNumber = $time; + + $Url = 'http://m.ctrip.com/restapi/soa2/11009/json/PartnerPayOrder'; + + $ResponseJson = GetPost_http($Url,json_encode($PostData),'json'); + $ResponseData = json_decode($ResponseJson); + + //echo '支付'; + //print_r($ResponseData); + //支付同步回调信息 {"Status":"SUCCESS","PartnerName":"guilintravel","OrderNumber":"guilintravel1546071576","OperationDateTime":"2018-12-29 16:19:37","RetCode":0,"ResponseStatus":{"Timestamp":"\/Date(1546071577236+0800)\/","Ack":"Success","Errors":[],"Extension":[]}} + } } \ No newline at end of file diff --git a/application/third_party/tripadvisor_spider/controllers/index.php b/application/third_party/tripadvisor_spider/controllers/index.php index 2b8124b6..bc67b596 100644 --- a/application/third_party/tripadvisor_spider/controllers/index.php +++ b/application/third_party/tripadvisor_spider/controllers/index.php @@ -384,4 +384,33 @@ class Index extends CI_Controller { print_r(json_encode($detail_data)); } } + + public function ajax_get_reviews(){ + header('Access-Control-Allow-Origin:*'); + header('Access-Control-Allow-Methods:POST, GET'); + header('Access-Control-Max-Age:0'); + header('Access-Control-Allow-Headers:x-requested-with, Content-Type'); + header('Access-Control-Allow-Credentials:true'); + + $destination = $this->input->get_post('destination'); + + if(empty($destination)){ + header("HTTP/1.1 404 Not Found"); + exit('{"status":"404","reason":"请输入站点代码!"}'); + }else{ + $return_data = array(); + $ta_website = $this->config->item('tripadvisor_website'); + if(empty($ta_website[$destination])){ + header("HTTP/1.1 404 Not Found"); + exit('{"status":"404","reason":"请输入正确的站点代码!"}'); + } + + $return_data['list_url'] = str_replace('{PAGENUM}','',$ta_website[$destination]); + + //根据站点获取评论 + $list_reviews = $this->Tripadvisor_Review_model->get_fivelatestreviews($destination); + $return_data['list_reviews'] = $list_reviews; + print_r(json_encode($return_data)); + } + } } diff --git a/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php b/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php index d2f8cf21..5d84ee80 100644 --- a/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php +++ b/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php @@ -195,5 +195,21 @@ class Tripadvisor_Review_model extends CI_Model { $query = $this->INFO->query($sql,array($destination)); return $query->result(); } + + public function get_fivelatestreviews($destination){ + $sql = 'select top 5 + tr_review_title, + tr_content, + tr_member_name, + tr_member_loc, + tr_member_starts, + tr_review_date, + tr_visited_date, + tr_review_pics, + tr_datetime + from Ta_Reviews where tr_destination = ? and tr_member_starts = 5 order by tr_review_date desc'; + $query = $this->INFO->query($sql,array($destination)); + return $query->result(); + } } From 04a189e168855e017d8ad6e624cd9123726b1eb3 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 27 Jun 2019 11:13:24 +0800 Subject: [PATCH 03/26] =?UTF-8?q?=E6=90=BA=E7=A8=8B=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/trainsystem/controllers/addorders.php | 2 ++ .../third_party/trainsystem/controllers/callback.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/application/third_party/trainsystem/controllers/addorders.php b/application/third_party/trainsystem/controllers/addorders.php index 0ba6315e..0353c5dd 100644 --- a/application/third_party/trainsystem/controllers/addorders.php +++ b/application/third_party/trainsystem/controllers/addorders.php @@ -704,12 +704,14 @@ class addorders extends CI_Controller{ $PostData = array(); $TimeStamp = time(); $time = date('Y-m-d H:i:s',$TimeStamp); + $PostData['Authentication'] = new stdClass(); $PostData['Authentication']->TimeStamp = $time; $PostData['Authentication']->ServiceName = 'order.PartnerPayOrder'; $PostData['Authentication']->PartnerName = ORDERUSER; $MessageIdentity = md5($time.'order.PartnerPayOrder'.ORDERKEY); $PostData['Authentication']->MessageIdentity = $MessageIdentity; + $PostData['TrainOrderService'] = new stdClass(); $PostData['TrainOrderService']->PartnerName = ORDERUSER; $PostData['TrainOrderService']->OrderNumber = $CtripOrder; $PostData['TrainOrderService']->PayedPrice = $Price; diff --git a/application/third_party/trainsystem/controllers/callback.php b/application/third_party/trainsystem/controllers/callback.php index b6d36723..89473b1f 100644 --- a/application/third_party/trainsystem/controllers/callback.php +++ b/application/third_party/trainsystem/controllers/callback.php @@ -153,9 +153,9 @@ class callback extends CI_Controller{ public function ctripcallback(){ $back_json = file_get_contents('php://input'); log_message('error','携程回调信息:'.$back_json); - /*$back_json = '{"Authentication":{"ServiceName":"web.order.returnTicketNotice","PartnerName":"tieyou","TimeStamp":"2019-1-18 11:35:22","MessageIdentity":"93F2BA3253829E8FAD29B5DEB7646A59"},"TrainOrderService":{"contactName":{},"contactMobile":{},"OrderNumber":"guilintravel1547778269","refundTicket":{"childBillId":{},"orderId":"8360041214","eOrderNumber":"EB59937931","eOrderType":"1","seatNumber":"01D\u53f7","passport":"544712454","passportName":"YANGFRANCISCHENG","realName":"YANGFRANCISCHENG","status":"1","reason":"\u9000\u7968\u6210\u529f\uff0c\u9000\u6b3e\u91d1\u989d:218.50\u5143"}}}';*/ + $back_json = '{"@attributes":{"xsi":"http:\/\/www.w3.org\/2001\/XMLSchema-instance"},"Authentication":{"TimeStamp":"2019-06-27 11:01:15","ServiceName":"web.order.notifyTicket","MessageIdentity":"08F97DF046FC32BB3F0CCBAF2DAAFB60","PartnerName":"tieyou"},"TrainOrderService":{"OrderInfo":{"OrderNumber":"guilintravel1561604425","ElectronicOrderNumber":"ED35331748","OrderType":"\u7535\u5b50","OrderTotleFee":"490.50","TicketInfo":{"OrderTicketFromStation":"\u54c8\u5c14\u6ee8\u897f","OrderTicketToStation":"\u5317\u4eac","OrderTicketYMD":"20190726","OrderTicketTime":"10:43","OrderTicketCheci":"D102","OrderTicketPrice":"490.50","OrderAcceptSeat":{"0":"\n "},"OrderTicketSeat":"\u4e00\u7b49\u5ea7","SeatNumber":"08\u8f66\u53a214F\u53f7","railwayTip":{"0":"\n "},"AuditTicketCount":"1","ChildTicketCount":"0","Passengers":{"Passenger":{"RealName":"SHCHERBAKOVOLEG","IdentityType":"\u62a4\u7167","NumberID":"655103175","TicketType":"\u6210\u4eba\u7968","Birth":{"0":"\n "},"InsuranceCount":"0"}}},"TicketInfoFinal":{"OrderTicketFromStation":"\u54c8\u5c14\u6ee8\u897f","OrderTicketToStation":"\u5317\u4eac","ChildBillid":{"0":"\n "},"ElectronicOrderNumber":"ED35331748","Result":"2","NoTicketReasons":{"0":"\n "},"OrderTicketYMD":"20190726","OrderTicketTime":"10:43","OrderTicketCheci":"D102","OrderTicketPrice":"490.50","SeatNumber":"08\u8f66\u53a214F\u53f7","railwayTip":{"0":"\n "},"TicketCheck":"\u68c0\u7968\u53e3B3\u53f7\u53e3","IsUserAcount":"0","ReturnFlag":"0","RescheduleFlag":"0","Tickets":{"Ticket":{"OrderTicketSeat":"\u4e00\u7b49\u5ea7","TicketType":"\u6210\u4eba\u7968","OrderTicketPrice":"490.50","TicketCount":"1","DetailInfos":{"DetailInfo":{"PassengerName":"SHCHERBAKOVOLEG","IdentityType":"\u62a4\u7167","NumberID":"655103175","SeatNo":"08\u8f66\u53a214F\u53f7"}}}}}}}}'; $ctrip_backdata = json_decode($back_json); - //print_r($ctrip_backdata); + //print_r($ctrip_backdata);die(); if(!empty($ctrip_backdata)){ $update_data = new stdClass(); $update_data->ServiceName = $ctrip_backdata->Authentication->ServiceName; @@ -170,7 +170,7 @@ class callback extends CI_Controller{ $update_data->reschedulecallback = ''; if($update_data->ServiceName == 'web.order.notifyTicket'){ - $update_data->OrderStatus = '4'; + $update_data->status = '4'; $update_data->ErrorMsg = '出票成功'; $update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber; $update_data->OrderTotleFee = $ctrip_backdata->TrainOrderService->OrderInfo->OrderTotleFee; @@ -276,12 +276,12 @@ class callback extends CI_Controller{ $this->BIZ_train_model->update_cold_planvei_sn($cold_sn); }else if($update_data->ServiceName == 'web.order.notifyNoTicket'){ $update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber; - $update_data->OrderStatus = '1'; + $update_data->status = '1'; $update_data->ErrorMsg = $ctrip_backdata->TrainOrderService->OrderInfo->NoTicketReasons; $update_data->confirmcallback = $back_json; }else if($update_data->ServiceName == 'web.order.returnTicketNotice'){ $update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderNumber; - $update_data->OrderStatus = '7'; + $update_data->status = '7'; $update_data->ErrorMsg = $ctrip_backdata->TrainOrderService->refundTicket->reason; $update_data->returncallback = $back_json; From 09c2df7f814ae6286ff5635d7dabbe4ec766d040 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 27 Jun 2019 11:26:46 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=BA=E7=A8=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/trainsystem/controllers/callback.php | 4 ++++ .../third_party/trainsystem/models/train_system_model.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/application/third_party/trainsystem/controllers/callback.php b/application/third_party/trainsystem/controllers/callback.php index 89473b1f..25c8dccc 100644 --- a/application/third_party/trainsystem/controllers/callback.php +++ b/application/third_party/trainsystem/controllers/callback.php @@ -192,6 +192,7 @@ class callback extends CI_Controller{ $data_passager = new stdClass(); $string = ''; $i = 0; + if($person_num > 1){ foreach ($ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo as $items){ if(strpos($items->SeatNo,'车厢')){ @@ -205,6 +206,7 @@ class callback extends CI_Controller{ } //对订票乘客进行存储 + $data_passager->status = '4'; $data_passager->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber; $data_passager->realname = $items->PassengerName; $data_passager->identitytype = $items->IdentityType; @@ -230,6 +232,7 @@ class callback extends CI_Controller{ } //对订票乘客进行存储 + $data_passager->status = '4'; $data_passager->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber; $data_passager->realname = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->PassengerName; $data_passager->identitytype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->IdentityType; @@ -261,6 +264,7 @@ class callback extends CI_Controller{ //添加支付记录 $add_train_payment_data->TOC_Memo = $update_data->ordernumber; + //根据订单号获取cold_sn $order_info = $this->train_system_model->get_order_info($update_data->ordernumber); $cold_sn = $order_info->ts_cold_sn; diff --git a/application/third_party/trainsystem/models/train_system_model.php b/application/third_party/trainsystem/models/train_system_model.php index 9b84793a..589ea4c1 100644 --- a/application/third_party/trainsystem/models/train_system_model.php +++ b/application/third_party/trainsystem/models/train_system_model.php @@ -259,6 +259,11 @@ class train_system_model extends CI_Model { return $query->row(); } + public function get_order_info($ordernumber){ + $sql = "select * from trainsystem where ts_ordernumber = '$ordernumber'"; + $query = $this->INFO->query($sql); + return $query->row(); + } public function test(){ $sql = "delete from trainsystem where ts_cold_sn = '488121613_1552637689'"; From 62acd21c941c8ab908fb209d026d97d8c914c044 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 27 Jun 2019 11:29:51 +0800 Subject: [PATCH 05/26] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=BA=E7=A8=8B?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/trainsystem/controllers/callback.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/third_party/trainsystem/controllers/callback.php b/application/third_party/trainsystem/controllers/callback.php index 25c8dccc..983e94d9 100644 --- a/application/third_party/trainsystem/controllers/callback.php +++ b/application/third_party/trainsystem/controllers/callback.php @@ -170,7 +170,7 @@ class callback extends CI_Controller{ $update_data->reschedulecallback = ''; if($update_data->ServiceName == 'web.order.notifyTicket'){ - $update_data->status = '4'; + $update_data->OrderStatus = '4'; $update_data->ErrorMsg = '出票成功'; $update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber; $update_data->OrderTotleFee = $ctrip_backdata->TrainOrderService->OrderInfo->OrderTotleFee; @@ -280,19 +280,19 @@ class callback extends CI_Controller{ $this->BIZ_train_model->update_cold_planvei_sn($cold_sn); }else if($update_data->ServiceName == 'web.order.notifyNoTicket'){ $update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber; - $update_data->status = '1'; + $update_data->OrderStatus = '1'; $update_data->ErrorMsg = $ctrip_backdata->TrainOrderService->OrderInfo->NoTicketReasons; $update_data->confirmcallback = $back_json; }else if($update_data->ServiceName == 'web.order.returnTicketNotice'){ $update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderNumber; - $update_data->status = '7'; + $update_data->OrderStatus = '7'; $update_data->ErrorMsg = $ctrip_backdata->TrainOrderService->refundTicket->reason; $update_data->returncallback = $back_json; //退票时还需要单独对对每个乘客存储回调信息 $passpager_info = new stdClass(); $passpager_info->returncallback = $back_json; - $passpager_info->status = '7'; + $passpager_info->OrderStatus = '7'; $passpager_info->ordernumber = $ctrip_backdata->TrainOrderService->OrderNumber; $passpager_info->realname = $ctrip_backdata->TrainOrderService->refundTicket->realName; $passpager_info->numberid = $ctrip_backdata->TrainOrderService->refundTicket->passport; From a55af9251671c007155a563be8be11058bdd6ae4 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 27 Jun 2019 11:29:42 +0800 Subject: [PATCH 06/26] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=A4=84=E7=90=86?= =?UTF-8?q?=E7=9A=84url=E5=9C=A8=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/config/wxpay.php | 1 + .../pay/controllers/PaymentService.php | 21 +++++++++++++++++++ .../pay/controllers/WxpayService.php | 2 +- webht/third_party/pay/views/payment_list.php | 9 +++++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/webht/third_party/pay/config/wxpay.php b/webht/third_party/pay/config/wxpay.php index ac42b017..2f0f4888 100644 --- a/webht/third_party/pay/config/wxpay.php +++ b/webht/third_party/pay/config/wxpay.php @@ -4,6 +4,7 @@ $config["trade_type"] = "NATIVE"; $config["currency"] = "CNY"; $config["currency_unit"] = 100; $config["method_code"] = 15016; +$config["send_notify_url"] = "https://www.mycht.cn/webht.php/apps/pay/paymentservice/send_notify"; /*! * 各账号的设置 */ diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index e1b190a9..df8bd6b7 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -32,6 +32,27 @@ 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; + } + }); /** * 导出记录用的记录节点 diff --git a/webht/third_party/pay/controllers/WxpayService.php b/webht/third_party/pay/controllers/WxpayService.php index 0d67bc7a..b7268920 100644 --- a/webht/third_party/pay/controllers/WxpayService.php +++ b/webht/third_party/pay/controllers/WxpayService.php @@ -91,7 +91,7 @@ class WxpayService extends CI_Controller { foreach ($all_account as $account) { $this->download_bill($account); } - async_curl("https://www.mycht.cn/webht.php/apps/pay/paymentservice/send_notify"); + async_curl($this->config->item('send_notify_url', 'wxpay')); return; } diff --git a/webht/third_party/pay/views/payment_list.php b/webht/third_party/pay/views/payment_list.php index 87fcf563..b568e59e 100644 --- a/webht/third_party/pay/views/payment_list.php +++ b/webht/third_party/pay/views/payment_list.php @@ -21,6 +21,12 @@ .search-btn{cursor: pointer; background: url(//data.chinahighlights.com/css/images/global/site-search-button.png) no-repeat center center;} .input-check{width: 20px;height: 20px;} label span{vertical-align: super;} + .brand_text {color: #fff; padding: 2px 3px; border-radius: 4px;font-style: italic;} + /* .wechat-color {background-color: #00C800;} */ + .wechat-color {background-color: #62B900;} + .paypal-color {background-color: #002D89;} + .alipay-color {background-color: #00AAEE;} + .ipaylinks-color,.creditcard-color {background-color: #A31022;} @@ -192,7 +198,8 @@ ?> - OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?> + brand_name))."-color"; ?>">brand_name; ?> + OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?> OPN_payerEmail; From d1f5bad5815677f70fc3e573438920fc85c3d7d9 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 27 Jun 2019 11:33:33 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=9A=84warnging=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/trainsystem/controllers/callback.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/third_party/trainsystem/controllers/callback.php b/application/third_party/trainsystem/controllers/callback.php index 983e94d9..fe9659db 100644 --- a/application/third_party/trainsystem/controllers/callback.php +++ b/application/third_party/trainsystem/controllers/callback.php @@ -153,7 +153,7 @@ class callback extends CI_Controller{ public function ctripcallback(){ $back_json = file_get_contents('php://input'); log_message('error','携程回调信息:'.$back_json); - $back_json = '{"@attributes":{"xsi":"http:\/\/www.w3.org\/2001\/XMLSchema-instance"},"Authentication":{"TimeStamp":"2019-06-27 11:01:15","ServiceName":"web.order.notifyTicket","MessageIdentity":"08F97DF046FC32BB3F0CCBAF2DAAFB60","PartnerName":"tieyou"},"TrainOrderService":{"OrderInfo":{"OrderNumber":"guilintravel1561604425","ElectronicOrderNumber":"ED35331748","OrderType":"\u7535\u5b50","OrderTotleFee":"490.50","TicketInfo":{"OrderTicketFromStation":"\u54c8\u5c14\u6ee8\u897f","OrderTicketToStation":"\u5317\u4eac","OrderTicketYMD":"20190726","OrderTicketTime":"10:43","OrderTicketCheci":"D102","OrderTicketPrice":"490.50","OrderAcceptSeat":{"0":"\n "},"OrderTicketSeat":"\u4e00\u7b49\u5ea7","SeatNumber":"08\u8f66\u53a214F\u53f7","railwayTip":{"0":"\n "},"AuditTicketCount":"1","ChildTicketCount":"0","Passengers":{"Passenger":{"RealName":"SHCHERBAKOVOLEG","IdentityType":"\u62a4\u7167","NumberID":"655103175","TicketType":"\u6210\u4eba\u7968","Birth":{"0":"\n "},"InsuranceCount":"0"}}},"TicketInfoFinal":{"OrderTicketFromStation":"\u54c8\u5c14\u6ee8\u897f","OrderTicketToStation":"\u5317\u4eac","ChildBillid":{"0":"\n "},"ElectronicOrderNumber":"ED35331748","Result":"2","NoTicketReasons":{"0":"\n "},"OrderTicketYMD":"20190726","OrderTicketTime":"10:43","OrderTicketCheci":"D102","OrderTicketPrice":"490.50","SeatNumber":"08\u8f66\u53a214F\u53f7","railwayTip":{"0":"\n "},"TicketCheck":"\u68c0\u7968\u53e3B3\u53f7\u53e3","IsUserAcount":"0","ReturnFlag":"0","RescheduleFlag":"0","Tickets":{"Ticket":{"OrderTicketSeat":"\u4e00\u7b49\u5ea7","TicketType":"\u6210\u4eba\u7968","OrderTicketPrice":"490.50","TicketCount":"1","DetailInfos":{"DetailInfo":{"PassengerName":"SHCHERBAKOVOLEG","IdentityType":"\u62a4\u7167","NumberID":"655103175","SeatNo":"08\u8f66\u53a214F\u53f7"}}}}}}}}'; + //$back_json = '{"@attributes":{"xsi":"http:\/\/www.w3.org\/2001\/XMLSchema-instance"},"Authentication":{"TimeStamp":"2019-06-27 11:01:15","ServiceName":"web.order.notifyTicket","MessageIdentity":"08F97DF046FC32BB3F0CCBAF2DAAFB60","PartnerName":"tieyou"},"TrainOrderService":{"OrderInfo":{"OrderNumber":"guilintravel1561604425","ElectronicOrderNumber":"ED35331748","OrderType":"\u7535\u5b50","OrderTotleFee":"490.50","TicketInfo":{"OrderTicketFromStation":"\u54c8\u5c14\u6ee8\u897f","OrderTicketToStation":"\u5317\u4eac","OrderTicketYMD":"20190726","OrderTicketTime":"10:43","OrderTicketCheci":"D102","OrderTicketPrice":"490.50","OrderAcceptSeat":{"0":"\n "},"OrderTicketSeat":"\u4e00\u7b49\u5ea7","SeatNumber":"08\u8f66\u53a214F\u53f7","railwayTip":{"0":"\n "},"AuditTicketCount":"1","ChildTicketCount":"0","Passengers":{"Passenger":{"RealName":"SHCHERBAKOVOLEG","IdentityType":"\u62a4\u7167","NumberID":"655103175","TicketType":"\u6210\u4eba\u7968","Birth":{"0":"\n "},"InsuranceCount":"0"}}},"TicketInfoFinal":{"OrderTicketFromStation":"\u54c8\u5c14\u6ee8\u897f","OrderTicketToStation":"\u5317\u4eac","ChildBillid":{"0":"\n "},"ElectronicOrderNumber":"ED35331748","Result":"2","NoTicketReasons":{"0":"\n "},"OrderTicketYMD":"20190726","OrderTicketTime":"10:43","OrderTicketCheci":"D102","OrderTicketPrice":"490.50","SeatNumber":"08\u8f66\u53a214F\u53f7","railwayTip":{"0":"\n "},"TicketCheck":"\u68c0\u7968\u53e3B3\u53f7\u53e3","IsUserAcount":"0","ReturnFlag":"0","RescheduleFlag":"0","Tickets":{"Ticket":{"OrderTicketSeat":"\u4e00\u7b49\u5ea7","TicketType":"\u6210\u4eba\u7968","OrderTicketPrice":"490.50","TicketCount":"1","DetailInfos":{"DetailInfo":{"PassengerName":"SHCHERBAKOVOLEG","IdentityType":"\u62a4\u7167","NumberID":"655103175","SeatNo":"08\u8f66\u53a214F\u53f7"}}}}}}}}'; $ctrip_backdata = json_decode($back_json); //print_r($ctrip_backdata);die(); if(!empty($ctrip_backdata)){ @@ -263,6 +263,7 @@ class callback extends CI_Controller{ $update_data->bookcallback = $back_json; //添加支付记录 + $add_train_payment_data = new stdClass(); $add_train_payment_data->TOC_Memo = $update_data->ordernumber; //根据订单号获取cold_sn From c07aa336768ac392026ea5f7e29564254b2e149c Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 27 Jun 2019 11:58:07 +0800 Subject: [PATCH 08/26] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:fixe?= =?UTF-8?q?d=E5=AE=A2=E4=BA=BA=E5=B9=B4=E9=BE=84=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/helpers/array_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webht/third_party/vendorPlanSync/helpers/array_helper.php b/webht/third_party/vendorPlanSync/helpers/array_helper.php index 2f6ec50f..7ec980a7 100644 --- a/webht/third_party/vendorPlanSync/helpers/array_helper.php +++ b/webht/third_party/vendorPlanSync/helpers/array_helper.php @@ -169,7 +169,7 @@ function real_phone_number($phone, $nation_code) function calc_age($birthday) { $now = new DateTime(); - $birth = new DateTime(strstr($birthday, " ", TRUE)); + $birth = new DateTime($birthday); $date_d = $now->diff($birth); $d_t = ($date_d->format("%y")); return $d_t; @@ -181,7 +181,7 @@ function calc_age_type($birthday) return 1; } $age = calc_age($birthday); - if ($age < 18) { + if ($age > 0 && $age < 18) { return 2; } return 1; From 21a481dc822fb7588f195ce2d04bf9049a533315 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 27 Jun 2019 14:58:58 +0800 Subject: [PATCH 09/26] =?UTF-8?q?Trippest=E8=B4=A2=E5=8A=A1=E8=A1=A8:fixed?= =?UTF-8?q?=E5=9B=A2=E5=90=8D=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/trippestOrderSync/controllers/order_finance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webht/third_party/trippestOrderSync/controllers/order_finance.php b/webht/third_party/trippestOrderSync/controllers/order_finance.php index ef30746f..d880d350 100644 --- a/webht/third_party/trippestOrderSync/controllers/order_finance.php +++ b/webht/third_party/trippestOrderSync/controllers/order_finance.php @@ -90,7 +90,7 @@ class Order_finance extends CI_Controller { $report_order['qtMoney'] = 0; $report_order['orderstats'] = 1; $report_order['ordernumber'] = $order_info->ordernumber; - $report_order['TuanName'] = mb_substr($order_info->TuanName, 0, 50); + $report_order['TuanName'] = mb_convert_encoding(substr($order_info->TuanName, 0, 50), 'UTF-8'); $report_order['operater'] = $order_info->operater; $report_order['Agenter'] = mb_substr($order_info->Agenter,0,10); $report_order['ChinaName'] = $order_info->ChinaName; From 4e2ece1a67e5ff3036bb994afdb262bd6fb899dd Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 27 Jun 2019 15:49:38 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=E9=80=80=E6=AC=BE:=E5=87=BA=E5=9B=A2?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=9C=A8=E4=B8=8A=E6=9C=88=E5=BA=95=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E9=9C=80=E8=A6=81=E5=8F=91=E9=80=81=E8=B4=A2?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/AlipayTradeService.php | 8 ++++++-- .../pay/controllers/iPayLinksService.php | 7 +++++-- .../models/Online_payment_account_model.php | 2 +- webht/third_party/paypal/controllers/index.php | 8 +++++--- .../third_party/paypal/models/paypal_model.php | 18 ++++++++++++++++++ 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index 173346c2..712309ea 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -703,8 +703,12 @@ class AlipayTradeService extends CI_Controller $this->Alipay_note_model->update_send($item->ALI_dealId, 'send-customer'); } //添加邮件发送记录 end - // TODO 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录 - if ($this->payment_model->if_finance_exists($advisor_info->COLI_GRI_SN)===true) { + // 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录 + // 更新是否需要发送财务 + $refund_finance_day = 20; + $now_day = date('d'); + $late_entry_date_set = $now_day<$refund_finance_day ? date('Y-m-01', strtotime("-1 month")) : date('Y-m-01'); + if ($this->payment_model->if_finance_done($advisor_info->COLI_GRI_SN, $late_entry_date_set) === true) { $this->Note_model->update_send($item->ALI_dealId, 'send-to-finance'); } return ; diff --git a/webht/third_party/pay/controllers/iPayLinksService.php b/webht/third_party/pay/controllers/iPayLinksService.php index b5f5085e..a92a29d0 100644 --- a/webht/third_party/pay/controllers/iPayLinksService.php +++ b/webht/third_party/pay/controllers/iPayLinksService.php @@ -770,10 +770,13 @@ class IPayLinksService extends CI_Controller } //添加邮件发送记录 end // 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录 - if ($this->payment_model->if_finance_exists($advisor_info->COLI_GRI_SN)===true) { + // 更新是否需要发送财务 + $refund_finance_day = 20; + $now_day = date('d'); + $late_entry_date_set = $now_day<$refund_finance_day ? date('Y-m-01', strtotime("-1 month")) : date('Y-m-01'); + if ($this->payment_model->if_finance_done($advisor_info->COLI_GRI_SN, $late_entry_date_set) === true) { $this->Note_model->update_send($item->IPL_dealId, 'send-to-finance'); } - return ; } diff --git a/webht/third_party/pay/models/Online_payment_account_model.php b/webht/third_party/pay/models/Online_payment_account_model.php index 599f1204..d1c33493 100644 --- a/webht/third_party/pay/models/Online_payment_account_model.php +++ b/webht/third_party/pay/models/Online_payment_account_model.php @@ -348,7 +348,6 @@ class Online_payment_account_model extends CI_Model { and cgi.CGI_GRI_SN=? "; return $this->HT->query($sql, array($gri_sn))->num_rows() > 0; } - // 商务订单没有生成团信息 public function if_finance_done($gri_sn, $late_date) { $sql = "SELECT top 1 1 @@ -356,6 +355,7 @@ class Online_payment_account_model extends CI_Model { where GRI_SN=? and GRI_EntranceDate < ? "; + // 商务订单没有生成团信息 if ($this->HT->query($sql, array($gri_sn,$late_date))->num_rows() === 0) { $sql = "SELECT top 1 1 from BIZ_ConfirmLineInfo coli diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 85bde232..924398b9 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -1003,8 +1003,6 @@ class Index extends CI_Controller { /*! * 退款处理 * @date 2019-05-05 - * TODO: - * * 退款的记录增加发送财务的状态 */ public function send_refund($item, $handpick, $old_ssje=NULL) { @@ -1136,7 +1134,11 @@ class Index extends CI_Controller { } //添加邮件发送记录 end // 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录 - if ($this->Paypal_model->if_finance_exists($advisor_info->COLI_GRI_SN)===true) { + // 更新是否需要发送财务 + $refund_finance_day = 20; + $now_day = date('d'); + $late_entry_date_set = $now_day<$refund_finance_day ? date('Y-m-01', strtotime("-1 month")) : date('Y-m-01'); + if ($this->Paypal_model->if_finance_done($advisor_info->COLI_GRI_SN, $late_entry_date_set) === true) { $this->Note_model->update_send($item->pn_txn_id, 'send-to-finance', $item->pn_sn); } return ; diff --git a/webht/third_party/paypal/models/paypal_model.php b/webht/third_party/paypal/models/paypal_model.php index 50625797..65b49d4a 100644 --- a/webht/third_party/paypal/models/paypal_model.php +++ b/webht/third_party/paypal/models/paypal_model.php @@ -687,4 +687,22 @@ class Paypal_model extends CI_Model { and cgi.CGI_GRI_SN=? "; return $this->HT->query($sql, $gri_sn)->num_rows() > 0; } + public function if_finance_done($gri_sn, $late_date) + { + $sql = "SELECT top 1 1 + from groupinfo gri + where GRI_SN=? + and GRI_EntranceDate < ? + "; + // 商务订单没有生成团信息 + if ($this->HT->query($sql, array($gri_sn,$late_date))->num_rows() === 0) { + $sql = "SELECT top 1 1 + from BIZ_ConfirmLineInfo coli + inner join BIZ_ConfirmLineDetail cold on COLD_COLI_SN=COLI_SN and isnull(cold.DeleteFlag,0)=0 + where COLI_GRI_SN=? + and COLD_StartDateHT->query($sql, array($gri_sn,$late_date))->num_rows() > 0; + } + return false; + } } From f2b9dae2cb667a4c8df971dd7dd43ab4fd606a5b Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 28 Jun 2019 10:43:08 +0800 Subject: [PATCH 11/26] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:=20?= =?UTF-8?q?=E5=95=86=E5=8A=A1=E7=BB=84=E7=9A=84tour=E8=AE=BE=E4=B8=BA?= =?UTF-8?q?=E5=9B=A2=E9=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendorPlanSync/libraries/Tulanduo.php | 3 ++- .../vendorPlanSync/models/BIZ_orders_model.php | 1 - .../vendorPlanSync/models/Group_model.php | 16 +++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 33e91b1b..b0742e2e 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -315,6 +315,7 @@ class Tulanduo } // 查询是否变更 deprecated at 2019-05 $sync_orderstate = 10; + $set_update = false; $this->ci->tldOrderBuilder->clearModifyLogInfo(); $resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder); $response = json_decode($resp); @@ -374,7 +375,7 @@ class Tulanduo $pag->PAG_Title = $this->tulanduo_trippest_pag[$pag->PAG_Code]->PAG_Title; } // 合作的产品 - if ($this->ci->trippest->if_tour_pvt(array($pag))===1) { + if ($this->ci->trippest->if_tour_pvt(array($pag))===1 || isset($pag->is_biz)) { $apart["pvt"]['details'][] = $pag; } else { $apart["com"]['details'][$pag->PAG_Code][] = $pag; diff --git a/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php b/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php index c7f56fc3..e6982ad7 100644 --- a/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php +++ b/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php @@ -104,7 +104,6 @@ class BIZ_Orders_model extends CI_Model { $sql = "SELECT * from BIZ_PackageOrderInfo poi where poi.POI_COLD_SN IN ($COLD_SN_str)"; -log_message('error',$sql); return $this->HT->query($sql)->result(); } diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 40ed0810..62ab259f 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -20,10 +20,11 @@ class Group_model extends CI_Model { from VendorArrangeState vas inner join Eva_ObjectInfo eoi on EOI_GRI_SN=VAS_GRI_SN and EOI_Type=1 and EOI_ObjSN=VAS_VEI_SN inner join GRoupInfo gri on GRI_SN=VAS_GRI_SN - where 1=1 AND VAS_VEI_SN in ($vendor_str) "; - $sql .= $gri_sn!==0 ? $gri_sql : " + where 1=1 AND VAS_VEI_SN in ($vendor_str) AND isnull(VAS_IsCancel,0)=0 AND isnull(VAS_Delete,0)=0 AND isnull(vas.DeleteFlag,0)=0 - AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0 + AND VAS_IsSendSucceed=1 "; + $sql .= $gri_sn!==0 ? $gri_sql : " + AND isnull(VAS_IsReceive,0)=0 -- AND EOI_GetDate between '$start_date' AND '$end_date' AND EOI_GetDate > CONVERT(date, GETDATE()) AND isnull(VAS_IsConfirm,0)=0 AND VAS_ConfirmSN IS NULL @@ -102,9 +103,10 @@ class Group_model extends CI_Model { $vgrd->ACI_PersonNum = intval($vcold->COLD_PersonNum); $vgrd->ACI_ChildNum = intval($vcold->COLD_ChildNum); $vgrd->ACI_BabyNum = intval($vcold->COLD_BabyNum); - $vgrd->PAG_DEI_SN = $vcold->PAG_DEI_SN; + $vgrd->PAG_DEI_SN = $vcold->PAG_DEI_SN ? $vcold->PAG_DEI_SN : 0; $vgrd->PAG_sub_sn = intval($vcold->COLD_ServiceSN2); $vgrd->vendor_memo = trim($vcold->COLD_vendorMemo); + $vgrd->is_biz = 1; if ( strval($vcold->COLD_ServiceType)==='D') { $vgrd->PAG_Code = mb_strtoupper($vcold->PAG_Code); $vgrd->PAG_ExtendType = mb_strtoupper($vcold->PAG_ExtendType); @@ -199,12 +201,16 @@ class Group_model extends CI_Model { return $this->HT->query($sql, array($gri_sn))->result(); } - public function get_sync_info($vas, $tour_code="") + public function get_sync_info($vas, $external_id=null, $tour_code="") { $sql = "SELECT * from VendorPlanSendout where VPS_VAS_SN=? "; $param_arr = array($vas); + if ($external_id !== null) { + $sql .= " AND VPS_externalId=? "; + $param_arr[] = $external_id; + } if ($tour_code !== "") { $sql .= " AND VPS_tourCode=? "; $param_arr[] = $tour_code; From 47b7f20573ae0632836601392fcc208106c9f991 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 28 Jun 2019 10:52:28 +0800 Subject: [PATCH 12/26] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A2=E4=BA=BA=E5=B9=B4=E9=BE=84=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index b0742e2e..113cd0e1 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -246,7 +246,7 @@ class Tulanduo $this_otherinfo .= "; " . $vg->Gender; } if (strval($vg->BirthDay) !== '') { - $this_otherinfo .= "; 生日:". $vg->BirthDay; + $this_otherinfo .= "; 生日:". $vg->BirthDay . "; " . calc_age($vg->BirthDay) . "岁"; } if (strval($vg->PassportValidDate) !== '') { $this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate; From 1b5433e16f8fd082408ac207ce8020ec2bf5188b Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 28 Jun 2019 11:50:19 +0800 Subject: [PATCH 13/26] =?UTF-8?q?curl=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/helpers/payment_helper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/webht/third_party/pay/helpers/payment_helper.php b/webht/third_party/pay/helpers/payment_helper.php index 6eb7f5b7..8a5cd3e4 100644 --- a/webht/third_party/pay/helpers/payment_helper.php +++ b/webht/third_party/pay/helpers/payment_helper.php @@ -70,6 +70,7 @@ function getaqiMonth($url){ */ function async_curl($url, $second = 1) { + log_message('error','Webht Async Call: '. $url); $ch = curl_init(); $curlVersion = curl_version(); $ua = "Webht (".PHP_OS.") PHP/".PHP_VERSION." CURL/".$curlVersion['version']." " . "AsyncJob"; From 0d61667e45b5a3c7d4815f91c561503f046b0f39 Mon Sep 17 00:00:00 2001 From: cyc Date: Fri, 28 Jun 2019 15:35:01 +0800 Subject: [PATCH 14/26] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=B7=E8=AF=ADAMP?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/htmlcompressor/views/amp-template/gm.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/application/third_party/htmlcompressor/views/amp-template/gm.php b/application/third_party/htmlcompressor/views/amp-template/gm.php index cf611876..1e4536bd 100644 --- a/application/third_party/htmlcompressor/views/amp-template/gm.php +++ b/application/third_party/htmlcompressor/views/amp-template/gm.php @@ -38,11 +38,9 @@ @AMP-COMMON-FOOTER@ - - Unsere Webseite verwendet Cookies um die Webseite st?ndig zu verbessern. Wenn Sie auf unserer Seite weitersurfen, stimmen Sie der Datenschutzerkl?rung zu. - Ich stimme zu. + +

Unsere Webseite verwendet Cookies um die Webseite ständig zu verbessern. Wenn Sie auf unserer Seite weitersurfen, stimmen Sie der Datenschutzerklärung zu. Mehr erfahren

+ Ich stimme zu
From 446ec6fec95c35434787d69158cf4a1a0e11b2f4 Mon Sep 17 00:00:00 2001 From: cyc Date: Fri, 28 Jun 2019 15:49:33 +0800 Subject: [PATCH 15/26] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BE=B7=E8=AF=ADAMP?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/htmlcompressor/views/amp-template/gm.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/third_party/htmlcompressor/views/amp-template/gm.php b/application/third_party/htmlcompressor/views/amp-template/gm.php index 1e4536bd..e5a6a44c 100644 --- a/application/third_party/htmlcompressor/views/amp-template/gm.php +++ b/application/third_party/htmlcompressor/views/amp-template/gm.php @@ -38,10 +38,12 @@ @AMP-COMMON-FOOTER@ +

Unsere Webseite verwendet Cookies um die Webseite ständig zu verbessern. Wenn Sie auf unserer Seite weitersurfen, stimmen Sie der Datenschutzerklärung zu. Mehr erfahren

Ich stimme zu
+
From 6c958dd91cee915d3fe5475195f2b6e137767865 Mon Sep 17 00:00:00 2001 From: cyc Date: Fri, 28 Jun 2019 16:42:04 +0800 Subject: [PATCH 16/26] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E4=B8=BA=E4=BB=A3=E7=A0=81=E6=A0=87=E7=AD=BE=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/htmlcompressor/views/amp-template/gm.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/application/third_party/htmlcompressor/views/amp-template/gm.php b/application/third_party/htmlcompressor/views/amp-template/gm.php index e5a6a44c..570456ba 100644 --- a/application/third_party/htmlcompressor/views/amp-template/gm.php +++ b/application/third_party/htmlcompressor/views/amp-template/gm.php @@ -38,11 +38,8 @@ @AMP-COMMON-FOOTER@ +@AMP-USERR-NOTIFICATION@ - -

Unsere Webseite verwendet Cookies um die Webseite ständig zu verbessern. Wenn Sie auf unserer Seite weitersurfen, stimmen Sie der Datenschutzerklärung zu. Mehr erfahren

- Ich stimme zu -
From ad583f130e316dd79de7ce9c125f4f50f2fecfe0 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 09:42:43 +0800 Subject: [PATCH 17/26] =?UTF-8?q?Alipay=E4=B8=8B=E8=BD=BD=E5=AF=B9?= =?UTF-8?q?=E8=B4=A6=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/AlipayTradeService.php | 150 ++++++++++++++++-- .../pay/controllers/WxpayService.php | 1 + .../pay/helpers/payment_helper.php | 24 ++- 3 files changed, 162 insertions(+), 13 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index 712309ea..ebe92174 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -130,7 +130,7 @@ class AlipayTradeService extends CI_Controller ,NULL ,strval($asyns_resp->data->gmt_create) ,strval($asyns_resp->data->gmt_payment) - ,json_encode($asyns_resp->data) + ,json_encode($asyns_resp->data,JSON_UNESCAPED_UNICODE) ,$notify_type ,$code ,strval($asyns_resp->data->trade_status) @@ -147,7 +147,7 @@ class AlipayTradeService extends CI_Controller ,NULL ,strval($asyns_resp->data->gmt_refund) ,strval($asyns_resp->data->notify_time) - ,json_encode($asyns_resp->data) + ,json_encode($asyns_resp->data,JSON_UNESCAPED_UNICODE) ,$notify_type ,$code ,strval($asyns_resp->data->trade_status) @@ -783,19 +783,151 @@ class AlipayTradeService extends CI_Controller */ public function get_billfile($date=NULL) { + ignore_user_abort(true); $request = new AlipayDataDataserviceBillDownloadurlQueryRequest(); - $date = $date===NULL ? "2019-05-16" : $date; + $date = $date===NULL ? date("Y-m-d", strtotime("-1 day")) : $date; $request->setBizContent("{" . "\"bill_type\":\"signcustomer\"," . "\"bill_date\":\"$date\"" . "}"); $response = $this->aopclientRequestExecute ($request); -// var_dump($response); $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; -var_dump($response->$responseNode); - // $resultCode = $result->$responseNode->code; - // if(!empty($resultCode)&&$resultCode == 10000){ - // } + $resultCode = $response->$responseNode->code; + if(empty($resultCode) || strval($resultCode) !== "10000"){ + return false; + } + set_time_limit(0); + $file = file_get_contents($response->$responseNode->bill_download_url); + $file_name = FCPATH.'download_statement\settlement_files\alipay\\' . $date . ".zip"; + $target = FCPATH.'download_statement\settlement_files\alipay\\' . $date ; + file_put_contents($file_name, $file); + $biz_detail_table = array(); + $biz_data_title = $this->bill_data_title(); + $finance_data_title = $this->finance_data_title(); + $zip = zip_open($file_name); + if ($zip) { + while ($zip_entry = zip_read($zip)) { + if (zip_entry_open($zip, $zip_entry, "r")) { + $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); + $content_convert = mb_convert_encoding($buf, 'UTF-8', 'GB2312'); + $content_row = explode("\n", $content_convert); + if (stripos($content_row[0], "业务明细")) { + $data_title = $biz_data_title; + } elseif (stripos($content_row[0], "账务明细")) { + $data_title = $finance_data_title; + } else { + zip_entry_close($zip_entry); + continue; + } + for ($i=5; $i < count($content_row); $i++) { + if (stripos($content_row[$i], "结束")) { + break; + } + $row = explode(',',$content_row[$i]); + $row_arr = array(); + foreach ($data_title as $key => $title) { + if ( ! isset($row[$key])) { + continue; + } + $row_arr[$title] = trim($row[$key]); + } + $biz_detail_table[] = $row_arr; + } + + zip_entry_close($zip_entry); + } + } + zip_close($zip); + } + if (empty($biz_detail_table)) { + return false; + } + foreach ($biz_detail_table as $key => $row) { + $total_amount = 0;$trade_type='';$trade_no = '';$has_charge=null; + if (isset($row['finance_id'])) { + if ($row['biz_type'] !== '其它') { + continue; + } + $total_amount = floatval($row['income'])>0 ? $row['income'] : $row['expenditure']; + $trade_type = floatval($total_amount)>0 ? 'pay' : 'refund'; + $trade_no = $row['trade_no']; + } else if (!empty($row['refund_id'])) { + $total_amount = bcadd($row['total_amount'],$row['charge_fee']); + $trade_type = 'refund'; + $trade_no = $row['refund_id']; + } else { + $total_amount = ($row['total_amount']); + $trade_type = 'pay'; + $trade_no = $row['trade_no']; + $has_charge = floatval($row['charge_fee'])==0 ? 1 : null; + } + $this->Alipay_note_model->save_alipay( + $trade_no + ,strval($row['out_trade_no']) + ,"CNY" + ,strval($total_amount) + ,NULL + ,$has_charge + ,strval($row['complete_time']) + ,strval($row['complete_time']) + ,json_encode($row,JSON_UNESCAPED_UNICODE) + ,$trade_type + ,null + ,'TRADE_SUCCESS' + ,NULL + ,$row['buyer_user_name'] + ); + } + return; + } + + public function bill_data_title() + { + return array( + "trade_no", // 支付宝交易号 + "out_trade_no", // 商户订单号 + "trade_type", // 业务类型 + "subject", // 商品名称 + "create_time", // 创建时间 + "complete_time", // 完成时间 + "store_id", // 门店编号 + "store_name", // 门店名称 + "operator", // 操作员 + "terminal_id", // 终端号 + "buyer_user_name", // 对方账户 + "total_amount", // 订单金额(元) + "receipt_amount", // 商家实收(元) + "coupon_amount", // 支付宝红包(元) + "point_amount", // 集分宝(元) + "alipayaccount_amount", // 支付宝优惠(元) + "mdiscount_amount", // 商家优惠(元) + "discount_amount", // 券核销金额(元) + "discount_name", // 券名称 + "mcoupon_amount", // 商家红包消费金额(元) + "pcard_amount", // 卡消费金额(元) + "refund_id", // 退款批次号/请求号 + "charge_fee", // 服务费(元) + "royalty_fee", // 分润(元) + "body" // 备注 + ); + } + + public function finance_data_title() + { + return array( + "finance_id",// 账务流水号 + "trade_no",// 业务流水号 + "out_trade_no",// 商户订单号 + "subject",// 商品名称 + "complete_time",// 发生时间 + "buyer_user_name",// 对方账号 + "income",// 收入金额(+元) + "expenditure",// 支出金额(-元) + "balance",// 账户余额(元) + "trading_channel",// 交易渠道 + "biz_type",// 业务类型:交易退款,在线支付,收费,其它 + "remark"// 备注 + ); } /** @@ -876,7 +1008,7 @@ var_dump($response->$responseNode); ,1 // 此处1表示通过收款码进来的, 不收手续费, 后续录入时分别处理 ,strval($query_pay->send_pay_date) ,strval($query_pay->send_pay_date) - ,json_encode($query_pay) + ,json_encode($query_pay,JSON_UNESCAPED_UNICODE) ,$pay_type ,NULL ,strval($query_pay->trade_status) diff --git a/webht/third_party/pay/controllers/WxpayService.php b/webht/third_party/pay/controllers/WxpayService.php index b7268920..2ea28dae 100644 --- a/webht/third_party/pay/controllers/WxpayService.php +++ b/webht/third_party/pay/controllers/WxpayService.php @@ -92,6 +92,7 @@ class WxpayService extends CI_Controller { $this->download_bill($account); } async_curl($this->config->item('send_notify_url', 'wxpay')); + async_curl('https://www.mycht.cn/webht.php/apps/pay/alipaytradeservice/get_billfile'); return; } diff --git a/webht/third_party/pay/helpers/payment_helper.php b/webht/third_party/pay/helpers/payment_helper.php index 8a5cd3e4..3d7ce814 100644 --- a/webht/third_party/pay/helpers/payment_helper.php +++ b/webht/third_party/pay/helpers/payment_helper.php @@ -78,12 +78,12 @@ function async_curl($url, $second = 1) curl_setopt($ch, CURLOPT_TIMEOUT, $second); curl_setopt($ch,CURLOPT_URL, $url); if(stripos($url,"https://")!==FALSE){ - curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); + // curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); + // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); } else { - curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE); - curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);//严格校验 + // curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE); + // curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);//严格校验 } curl_setopt($ch,CURLOPT_USERAGENT, $ua); //设置header @@ -270,3 +270,19 @@ function from_xml($xml) return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); } +/*! + * 转换字符集编码 + * @param $data + * @param $targetCharset + * @return string + */ +function characet($data, $targetCharset) { + if (!empty($data)) { + $fileType = "UTF-8"; + if (strcasecmp($fileType, $targetCharset) != 0) { + $data = mb_convert_encoding($data, $targetCharset, $fileType); + // $data = iconv($fileType, $targetCharset.'//IGNORE', $data); + } + } + return $data; +} From 4c8f3fb867b8364af186a8a3c283405804508b41 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 10:05:40 +0800 Subject: [PATCH 18/26] =?UTF-8?q?Alipay=20=E8=B4=A6=E5=8D=95=E4=B8=AD?= =?UTF-8?q?=E7=9A=84APP=E4=BA=A4=E6=98=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/AlipayTradeService.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index ebe92174..e206c23d 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -357,6 +357,12 @@ class AlipayTradeService extends CI_Controller continue; } + //检测是否是APP订单 + if ((strpos($item->ALI_memo, 'China Train Booking') !== false) || (strpos($item->ALI_memo, 'ChinaTrainBooking') !== false)) { + $item->ALI_orderId .= "_A"; + // $this->Alipay_note_model->update_send($item->ALI_dealId, 'send'); + } + //退款状态默认为已经处理,陆燕在退款前手动通知外联了,系统跳过处理 if ($item->ALI_payType == 'refund') { $this->send_refund($item); @@ -370,12 +376,6 @@ class AlipayTradeService extends CI_Controller continue; } - //检测是否是APP订单,默认不处理 - // if ((strpos($item->pn_memo, 'China Train Booking') !== false) || (strpos($item->pn_memo, 'ChinaTrainBooking') !== false)) { //APP自动出票的订单不需要处理 - // $this->Alipay_note_model->update_send($item->ALI_dealId, 'send'); - // continue; - // } - //根据note信息找到订单号 $orderid_info = analysis_orderid($item->ALI_orderId); @@ -399,7 +399,7 @@ class AlipayTradeService extends CI_Controller $this->Alipay_note_model->set_invoice($item->ALI_dealId, $orderid_info->orderid . '_' . $orderid_info->ordertype); //检测是否是APP订单,默认不处理 - if ($orderid_info->ordertype == 'A') { //APP自动出票的订单不需要处理 + if ($orderid_info->ordertype == 'A' && $item->ALI_payType == 'pay') { //APP自动出票的订单不需要处理 $this->Alipay_note_model->update_send($item->ALI_dealId, 'send'); continue; } From 1f0148634e4c8721a6dd6b160a051ca8eb6d523f Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 10:13:47 +0800 Subject: [PATCH 19/26] =?UTF-8?q?Alipay=20APP=E9=80=80=E6=AC=BE=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/AlipayTradeService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index e206c23d..d16ec46c 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -537,15 +537,15 @@ class AlipayTradeService extends CI_Controller $parent_note = $this->Alipay_note_model->note($parent_trade_no); // APP 组的退款查不到原始收款记录 todo if (empty($parent_note) ) { # && true === $this->Alipay_note_model->if_APP_order($parent_order) ) { - // $parent_note = $parent_payment; + $parent_note = $item; // 补充字段 // $parent_note->IPL_orderId = $parent_order . '_B'; // $parent_note->IPL_currencyCode = $parent_payment->currencyCode; // $parent_note->IPL_payerName = strval("''"); // $parent_note->IPL_payerEmail = strval("''"); - $this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail'); - return false; + // $this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail'); + // return false; } //订单号 $orderid_info = analysis_orderid($parent_note->ALI_orderId); From a1af22ee13083be92cf5fab51e942fd303adbaff Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 10:19:16 +0800 Subject: [PATCH 20/26] =?UTF-8?q?Alipay=E4=B8=8B=E8=BD=BD=E8=B4=A6?= =?UTF-8?q?=E5=8D=95=E4=B8=8D=E9=87=8D=E5=A4=8D=E5=86=99=E5=85=A5note?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/AlipayTradeService.php | 1 + webht/third_party/pay/models/Alipay_note_model.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index d16ec46c..d2079dd9 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -876,6 +876,7 @@ class AlipayTradeService extends CI_Controller ,'TRADE_SUCCESS' ,NULL ,$row['buyer_user_name'] + ,null,true ); } return; diff --git a/webht/third_party/pay/models/Alipay_note_model.php b/webht/third_party/pay/models/Alipay_note_model.php index cafe422b..ef99b7e4 100644 --- a/webht/third_party/pay/models/Alipay_note_model.php +++ b/webht/third_party/pay/models/Alipay_note_model.php @@ -89,8 +89,15 @@ class Alipay_note_model extends CI_Model { * @author LYT * @date 2017-08-29 */ - public function save_alipay($ALI_dealId,$ALI_orderId,$ALI_currencyCode,$ALI_orderAmount,$ALI_payAmount,$ALI_stateCode,$ALI_acquiringTime,$ALI_completeTime,$ALI_memo,$ALI_payType,$ALI_resultCode=null,$ALI_resultMsg=null,$ALI_payerName=null,$ALI_payerEmail=NULL) { - $sql = " + public function save_alipay($ALI_dealId,$ALI_orderId,$ALI_currencyCode,$ALI_orderAmount,$ALI_payAmount,$ALI_stateCode,$ALI_acquiringTime,$ALI_completeTime,$ALI_memo,$ALI_payType,$ALI_resultCode=null,$ALI_resultMsg=null,$ALI_payerName=null,$ALI_payerEmail=NULL, $check_exists=false) { + $sql = $check_exists===false ? "" : " + IF NOT EXISTS( + SELECT TOP 1 1 + FROM AlipayLog + WHERE ALI_dealId = '$ALI_dealId' + ) + "; + $sql .= " INSERT INTO AlipayLog ( ALI_dealId,ALI_orderId,ALI_currencyCode,ALI_orderAmount,ALI_payAmount,ALI_stateCode,ALI_acquiringTime,ALI_completeTime,ALI_memo,ALI_sent,ALI_noticeTime,ALI_payType,ALI_resultCode,ALI_resultMsg,ALI_payerName,ALI_payerEmail From 445676d267ccef6f730157830df2d7f79ffcf3d5 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 10:35:24 +0800 Subject: [PATCH 21/26] =?UTF-8?q?Alipay=E8=B4=A6=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86,=E4=B8=8D=E5=8F=91=E9=80=81=E4=BB=A5?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/AlipayTradeService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index d2079dd9..e7b49993 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -641,10 +641,10 @@ class AlipayTradeService extends CI_Controller $this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail'); return false; } - + $send_email = ($item->ALI_completeTime>date('Y-m-d', strtotime("-1 day"))); //添加邮件发送记录 // if (true) { // test - if ($item->ALI_sent !== 'send' && substr($item->ALI_sent, 0, 5) !== 'send-') { + if ($send_email===true && $item->ALI_sent !== 'send' && substr($item->ALI_sent, 0, 5) !== 'send-') { // 客人邮件中的外联落款 // $web_code = 'cht'; // 默认cht $web_lgc = 1; From cd7d16197c5f728b561967d41c0f1add05ef107c Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 11:45:09 +0800 Subject: [PATCH 22/26] =?UTF-8?q?Alipay=E8=B4=A6=E5=8D=95=E7=9A=84APP?= =?UTF-8?q?=E9=80=80=E6=AC=BE,=E6=9B=B4=E6=96=B0=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/AlipayTradeService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index e7b49993..1c178a6e 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -701,6 +701,8 @@ class AlipayTradeService extends CI_Controller $c_M_AddTime, 'ChinaHighlights refund receipt'); $this->Alipay_note_model->update_send($item->ALI_dealId, 'send-customer'); + } else { + $this->Alipay_note_model->update_send($item->ALI_dealId, 'send'); } //添加邮件发送记录 end // 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录 From 42d881a2b2ed71525db379d4616d75e3e82f13ed Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 11:51:48 +0800 Subject: [PATCH 23/26] bug --- webht/third_party/pay/controllers/AlipayTradeService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index 1c178a6e..c5e9cd3c 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -711,7 +711,7 @@ class AlipayTradeService extends CI_Controller $now_day = date('d'); $late_entry_date_set = $now_day<$refund_finance_day ? date('Y-m-01', strtotime("-1 month")) : date('Y-m-01'); if ($this->payment_model->if_finance_done($advisor_info->COLI_GRI_SN, $late_entry_date_set) === true) { - $this->Note_model->update_send($item->ALI_dealId, 'send-to-finance'); + $this->Alipay_note_model->update_send($item->ALI_dealId, 'send-to-finance'); } return ; } From 057cb6ec09e0aca84206cd5fb34331f8b2a9c50b Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 1 Jul 2019 16:37:49 +0800 Subject: [PATCH 24/26] =?UTF-8?q?Trippest=E5=90=8C=E6=AD=A5=E8=AE=A2?= =?UTF-8?q?=E5=8D=95:=E6=9B=B4=E6=96=B0=E5=90=AF=E7=A8=8B=E5=92=8C?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/trippestOrderSync/controllers/TulanduoApi.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php index dc30bcc4..562b5f6f 100644 --- a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php +++ b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php @@ -471,6 +471,8 @@ class TulanduoApi extends CI_Controller $cold_update_column["COLD_ServiceSN2"] = $pag_info->pag_sub; $cold_update_column["COLD_ServiceCity"] = $pag_info->serviceinfo->PAG_CII_SN; $cold_update_column["COLD_PlanVEI_SN"] = $vei_SN; + $cold_update_column["COLD_StartDate"] = $detail_jsonResp->orderDetail->travelDate; + $cold_update_column["COLD_EndDate"] = $detail_jsonResp->orderDetail->leaveDate; } $this->Order_update->cold_where_update = " COLD_SN=" . $cold_sn; $this->Order_update->biz_confirmlinedetail_update($cold_update_column); From e886059f98606f6fab866c2eab0243562de15231 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 2 Jul 2019 10:42:12 +0800 Subject: [PATCH 25/26] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:?= =?UTF-8?q?=E5=88=86=E9=94=80=E9=A2=84=E8=AE=A2Trippest=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 6 ++++++ webht/third_party/vendorPlanSync/models/Group_model.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 113cd0e1..595c65db 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -365,6 +365,9 @@ class Tulanduo if (intval($pag->PAG_DEI_SN)===1 && ! empty($pag->PAG_Code)) { $pag->PAG_Code = $this->ci->trippest->ch_code_transfer( mb_strtoupper($pag->PAG_Code)); $pag->PAG_ExtendType = $this->tulanduo_trippest_pag[$pag->PAG_Code]->PAG_ExtendType; + } else if (false !== stripos($pag->GRD_Landscape, 'trippest')) { + $apart["com"]['details'][$pag->PAG_Code][] = $pag; + continue; } if (empty($pag->PAG_Code)) // 已在grd查询中增加是否目的地产品的判断 { @@ -395,6 +398,9 @@ class Tulanduo if ($vi !== $vp) { unset($apart_com[$vi]); } + if (empty($apart_com[$vp]['details'])) { + $apart_com[$vp]['details'] = array(); + } // $apart_com[$vp]['details'][] = $apart['com']['details'][$vi]; $apart_com[$vp]['details'] = array_merge($apart_com[$vp]['details'], $apart['com']['details'][$vi]); $apart_com[$vp]['PAG_Code'] = $vp; diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 62ab259f..5dfecc4d 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -149,7 +149,7 @@ class Group_model extends CI_Model { * from ArrangeConfirmInfo aci left join BIZ_PackageInfo on PAG_SN=ACI_ServiceSN - and ACI_ServiceType='D' and PAG_DefaultVEI_SN=ACI_VEI_SN + and ACI_ServiceType='D' --and PAG_DefaultVEI_SN=ACI_VEI_SN -- 增加是否目的地产品的判断 and SUBSTRING(CONVERT(varchar(10), PAG_SourceType) ,1,3)='132' where 1=1 From 9ac653dccdfc897e8dd434a1a3f79814c88e8df4 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 2 Jul 2019 11:29:14 +0800 Subject: [PATCH 26/26] =?UTF-8?q?APP=E7=BB=84=E7=9A=84=E5=90=8E=E7=BC=80A,?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81=E6=9F=A5=E8=AF=A2=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=92=8C=E8=BD=AC=E7=A7=BB=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/PaymentService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index df8bd6b7..5af49913 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -428,7 +428,9 @@ class PaymentService extends CI_Controller { $data['order_info'] = $this->account_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype); if ($orderid_info->ordertype === 'T') { $data['gai_info'] = $this->account_model->get_money_t($pn_txn_id); - } elseif ($orderid_info->ordertype === 'B' || $orderid_info->ordertype === 'TP') { + } elseif ($orderid_info->ordertype === 'B' || $orderid_info->ordertype === 'TP' + || $orderid_info->ordertype === 'A' + ) { $data['gai_info'] = $this->account_model->get_money_b($pn_txn_id); } } @@ -463,7 +465,9 @@ class PaymentService extends CI_Controller { $old_ssje = $data['gai_info'][0]->GAI_SSJE; $this->account_model->delete_money_t($pn_txn_id); } - } elseif ($orderid_info->ordertype === 'B' || $orderid_info->ordertype === 'TP') { + } elseif ($orderid_info->ordertype === 'B' || $orderid_info->ordertype === 'TP' + || $orderid_info->ordertype === 'A' + ) { $data['gai_info'] = $this->account_model->get_money_b($pn_txn_id); if ( ! empty($data['gai_info'])) { $old_ssje = $data['gai_info'][0]->GAI_SSJE;