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();
}