From adbfbc0a3722d52811a2145456714994530d58ee Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 3 Dec 2018 15:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4=E4=BF=A1=E6=81=AF=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E5=8A=A0=E4=B8=8A=E4=B8=8B=E8=BD=BD=E9=93=BE=E6=8E=A5?= =?UTF-8?q?,=E6=96=B0=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E5=85=B6=E4=BB=96=E4=BF=A1=E6=81=AF=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8E=E5=88=A0=E9=99=A4;=20=E5=A2=9E=E5=8A=A0=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E4=BB=85=E6=9F=A5=E8=AF=A2=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8F=91=E9=80=81=E7=9A=84=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?id;=20=E5=95=86=E5=8A=A1=E8=AE=A2=E5=8D=95=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E7=94=A8=E4=BC=A0=E7=BB=9F=E8=AE=A2=E5=8D=95=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendorPlanSync/controllers/Tulanduo.php | 16 +++++++++------- .../vendorPlanSync/controllers/index.php | 9 +++++---- .../vendorPlanSync/libraries/vendor.php | 2 ++ .../vendorPlanSync/models/Group_model.php | 5 +++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/webht/third_party/vendorPlanSync/controllers/Tulanduo.php b/webht/third_party/vendorPlanSync/controllers/Tulanduo.php index 6657890e..0bbdc502 100644 --- a/webht/third_party/vendorPlanSync/controllers/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/controllers/Tulanduo.php @@ -76,6 +76,7 @@ class Tulanduo extends CI_Controller } // 商务 if (strval($order->GRI_OrderType) === "227002") { + return $this->push_tour($order); } // 传统订单 if (strval($order->GRI_OrderType) === "227001") { @@ -187,21 +188,21 @@ class Tulanduo extends CI_Controller $sync_orderstate = 10; $vps_sn = 0; $vendor_orderid = 0; - $modifyLogInfo = "
$change_info
"; + $plan_detail_page_url = "http://p.mycht.cn/Cooperate/Plan_Detail.aspx?GSN=" . $gri_sn; + $plan_detail_page = "
计划下载:$plan_detail_page_url
"; if (intval($is_send_vary)===1) { $vps = $this->Group_model->get_sync_info($vas_sn); if ( ! empty($vps)) { $vps_sn = $vps->VPS_SN; $vendor_orderid = $vps->VPS_externalId; $sync_orderstate = 11; - // $modifyLogInfo = "
https://www.trippest.com
"; + $modifyLogInfo = "$plan_detail_page
$change_info
"; $this->tldOrderBuilder->setOrderId($vendor_orderid) ->setModifyLogInfo($modifyLogInfo) ; } } else { - $plan_detail_page = "http://p.mycht.cn/Cooperate/Plan_Detail.aspx?GSN=" . $gri_sn; - $modifyLogInfo = "
计划下载:$plan_detail_page
"; + $modifyLogInfo = $plan_detail_page; $this->tldOrderBuilder->clearModifyLogInfo(); $this->tldOrderBuilder->setModifyLogInfo($modifyLogInfo) ; @@ -469,20 +470,21 @@ class Tulanduo extends CI_Controller $sync_orderstate = 10; $vps_sn = 0; $vendor_orderid = 0; + $plan_detail_page_url = "http://p.mycht.cn/Cooperate/Plan_Detail.aspx?GSN=" . $gri_sn; + $plan_detail_page = "
计划下载:$plan_detail_page_url
"; if (intval($is_send_vary)===1) { $vps = $this->Group_model->get_sync_info($vas_sn, $tour_code); if ( ! empty($vps)) { $vps_sn = $vps->VPS_SN; $vendor_orderid = $vps->VPS_externalId; $sync_orderstate = 11; - $modifyLogInfo = "
$change_info
"; + $modifyLogInfo = "$plan_detail_page
$change_info
"; $this->tldOrderBuilder->setOrderId($vendor_orderid) ->setModifyLogInfo($modifyLogInfo) ; } } else { - $plan_detail_page = "http://p.mycht.cn/Cooperate/Plan_Detail.aspx?GSN=" . $gri_sn; - $modifyLogInfo = "
计划下载:$plan_detail_page
"; + $modifyLogInfo = $plan_detail_page; $this->tldOrderBuilder->clearModifyLogInfo(); $this->tldOrderBuilder->setModifyLogInfo($modifyLogInfo) ; diff --git a/webht/third_party/vendorPlanSync/controllers/index.php b/webht/third_party/vendorPlanSync/controllers/index.php index 507ec818..ca5f618e 100644 --- a/webht/third_party/vendorPlanSync/controllers/index.php +++ b/webht/third_party/vendorPlanSync/controllers/index.php @@ -23,15 +23,15 @@ class Index extends CI_Controller { public function index() { - $vendor_plan = $this->Group_model->get_vendor_plan_info(214600, 1343); - return $this->output->set_content_type('application/json')->set_output(json_encode($vendor_plan)); + $auto_vendor_str = implode(",", $this->vendor->auto_vendor); + return $this->push(0, $auto_vendor_str); } - public function push($GRI_SN=0) + public function push($GRI_SN=0, $vendor_str=null) { $start_date = date('Y-m-d'); $end_date = date('Y-m-d 23:59:59', strtotime("+2 months")); - $ready_to_send = $this->Group_model->get_plan_not_received(1, $GRI_SN, $start_date, $end_date); + $ready_to_send = $this->Group_model->get_plan_not_received(1, $GRI_SN, $vendor_str, $start_date, $end_date); if (empty($ready_to_send)) { return $this->output->set_output("empty"); } @@ -41,6 +41,7 @@ class Index extends CI_Controller { require_once($controller_name . ".php"); $vendor_class = new $controller_name(); $call_fun = $vendor_class->order_push($order); + log_message('error',"Call [$controller_name>order_push] " . $order->GRI_SN); return $this->output->set_output($call_fun . $order->GRI_SN); } return $this->output->set_output("Not found vendor function. " . $order->GRI_SN); diff --git a/webht/third_party/vendorPlanSync/libraries/vendor.php b/webht/third_party/vendorPlanSync/libraries/vendor.php index 935e0ba8..ac8a0ddb 100644 --- a/webht/third_party/vendorPlanSync/libraries/vendor.php +++ b/webht/third_party/vendorPlanSync/libraries/vendor.php @@ -10,6 +10,8 @@ class Vendor $this->ci =& get_instance(); } + public $auto_vendor = array(1343,29188,30548); + public $vendor_fun = array( "1343" => "Tulanduo" ,"29188" => "Tulanduo" diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 45d3d5a3..5001fcb6 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -8,7 +8,7 @@ class Group_model extends CI_Model { $this->HT = $this->load->database('HT', TRUE); } - public function get_plan_not_received($top=1, $gri_sn=0, $start_date=null, $end_date=null) + public function get_plan_not_received($top=1, $gri_sn=0, $vendor_str=null, $start_date=null, $end_date=null) { $top_sql = $top>0 ? " TOP $top " : ""; $gri_sql = $gri_sn===0 ? "" : " and GRI_SN=$gri_sn "; @@ -26,10 +26,11 @@ class Group_model extends CI_Model { and VAS_IsSendSucceed=1 and VAS_IsConfirm=0 and EOI_GetDate between '$start_date' and '$end_date' - -- and VAS_VEI_SN in (29188, 1343, 30548) -- test + and VAS_VEI_SN in ($vendor_str) -- and GRI_OrderType=227002 -- test and (VAS_IsReceive=0 or (VAS_SendTime > ISNULL(VAS_ReceiveTime,0))) "; $sql .= " order by EOI_GetDate asc, vas.VAS_IsConfirm asc"; +// log_message('error',$sql); return $this->HT->query($sql)->result(); }