|
|
@ -56,9 +56,7 @@ class TulanduoApi extends CI_Controller
|
|
|
|
$this->load->helper('array');
|
|
|
|
$this->load->helper('array');
|
|
|
|
$this->load->model('Orders_model');
|
|
|
|
$this->load->model('Orders_model');
|
|
|
|
$this->load->model('TuLanDuo_queryContentBuilder', 'tld_order');
|
|
|
|
$this->load->model('TuLanDuo_queryContentBuilder', 'tld_order');
|
|
|
|
|
|
|
|
|
|
|
|
// $this->output->enable_profiler(TRUE);
|
|
|
|
// $this->output->enable_profiler(TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
/** test */
|
|
|
|
/** test */
|
|
|
|
// $this->userId = "358";
|
|
|
|
// $this->userId = "358";
|
|
|
|
// $this->key = "a08f26ddc5b1bd4c8e5eafcac28fc1ec";
|
|
|
|
// $this->key = "a08f26ddc5b1bd4c8e5eafcac28fc1ec";
|
|
|
@ -153,13 +151,13 @@ class TulanduoApi extends CI_Controller
|
|
|
|
$split_code = explode("-", $PAG_Code);
|
|
|
|
$split_code = explode("-", $PAG_Code);
|
|
|
|
$PAG_Code = $split_code[0] . "-" . $split_code[1];
|
|
|
|
$PAG_Code = $split_code[0] . "-" . $split_code[1];
|
|
|
|
isset($split_code[2]) ? $pag_sub=$split_code[2] : null;
|
|
|
|
isset($split_code[2]) ? $pag_sub=$split_code[2] : null;
|
|
|
|
// 旧的数据没有线路代号
|
|
|
|
} else if ( ! empty($temp_array)) {
|
|
|
|
log_message('error',"未识别的线路名称 $PAG_Code " . $vo['orderId'] . " " . $vo['routeName'] . var_export($temp_array, 1));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$PAG_Code = $pag_sub = null;
|
|
|
|
$PAG_Code = $pag_sub = null;
|
|
|
|
$split_code = explode("-", $temp_array[0]);
|
|
|
|
$split_code = explode("-", $temp_array[0]);
|
|
|
|
$PAG_Code = $split_code[0] . "-" . $split_code[1];
|
|
|
|
$PAG_Code = $split_code[0] . "-" . $split_code[1];
|
|
|
|
isset($split_code[2]) ? $pag_sub=$split_code[2] : null;
|
|
|
|
isset($split_code[2]) ? $pag_sub=$split_code[2] : null;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
log_message('error',"未识别的线路名称 $PAG_Code " . $vo['orderId'] . " " . $vo['routeName'] . var_export($temp_array, 1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$PAG_Code = in_array($PAG_Code, array("SHALC-6","SHALC-7","SHALC-8","SHALC-9")) ? "SHSIC-45" : $PAG_Code;
|
|
|
|
$PAG_Code = in_array($PAG_Code, array("SHALC-6","SHALC-7","SHALC-8","SHALC-9")) ? "SHSIC-45" : $PAG_Code;
|
|
|
|
$serviceSN = $this->Orders_model->get_packageSN($PAG_Code);
|
|
|
|
$serviceSN = $this->Orders_model->get_packageSN($PAG_Code);
|
|
|
@ -400,7 +398,7 @@ class TulanduoApi extends CI_Controller
|
|
|
|
,"COLI_CUrrency" => $travel_fee_currency
|
|
|
|
,"COLI_CUrrency" => $travel_fee_currency
|
|
|
|
);
|
|
|
|
);
|
|
|
|
$this->Order_update->biz_confirmlineinfo_update($coli_update_column);
|
|
|
|
$this->Order_update->biz_confirmlineinfo_update($coli_update_column);
|
|
|
|
/** BIZ_ConfirmLineDetail */ // nothing to update
|
|
|
|
/** BIZ_ConfirmLineDetail */
|
|
|
|
/** INSERT */
|
|
|
|
/** INSERT */
|
|
|
|
/*BIZ_BookPeople*/
|
|
|
|
/*BIZ_BookPeople*/
|
|
|
|
if ($this->Orders_model->bookpeople_exist($cold_sn) === array()) {
|
|
|
|
if ($this->Orders_model->bookpeople_exist($cold_sn) === array()) {
|
|
|
@ -648,6 +646,63 @@ class TulanduoApi extends CI_Controller
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
|
|
|
* 往前获取历史数据
|
|
|
|
|
|
|
|
* @date 2018-08-21
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function get_history_order_list($oldest_date=null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// $oldest_date===null ? $oldest_date = $this->Orders_model->get_oldest_offset() : null;
|
|
|
|
|
|
|
|
$oldest_date===null ? $oldest_date = '2018-05-10' : null; // test
|
|
|
|
|
|
|
|
$startTravelDate = date('Y-m-d', strtotime("-1 day", strtotime($oldest_date)));
|
|
|
|
|
|
|
|
$endTravelDate = $oldest_date;
|
|
|
|
|
|
|
|
$start_date = $this->input->get_post("start");
|
|
|
|
|
|
|
|
$end_date = $this->input->get_post("end");
|
|
|
|
|
|
|
|
$startTravelDate = $start_date ? $start_date : $startTravelDate;
|
|
|
|
|
|
|
|
$endTravelDate = $end_date ? $end_date : $endTravelDate;
|
|
|
|
|
|
|
|
$this->tld_order->setUserId($this->userId)
|
|
|
|
|
|
|
|
->setKey($this->key)
|
|
|
|
|
|
|
|
->setPageSize(20)
|
|
|
|
|
|
|
|
->setPageIndex(1)
|
|
|
|
|
|
|
|
->setStartTravelDate($startTravelDate)
|
|
|
|
|
|
|
|
->setEndTravelDate($endTravelDate) ;
|
|
|
|
|
|
|
|
var_export($startTravelDate);
|
|
|
|
|
|
|
|
var_export($endTravelDate);
|
|
|
|
|
|
|
|
$resp = $this->excute_curl($this->list_url, $this->tld_order);
|
|
|
|
|
|
|
|
$resp_arr = json_decode($resp, true);
|
|
|
|
|
|
|
|
if (intval($resp_arr['status']) !== 1) {
|
|
|
|
|
|
|
|
log_message('error','TulanduoApi get_orderlist history failed. Msg:' . $resp_arr['errMsg'] . "; Request: " . ($this->tld_order->getBizContent()));
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($resp_arr["responseData"]["totalRows"] == 0) {
|
|
|
|
|
|
|
|
log_message('error','TulanduoApi get_orderlist history 0. ');
|
|
|
|
|
|
|
|
// 继续往前滚日期
|
|
|
|
|
|
|
|
$this->get_history_order_list($startTravelDate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$all_list = $resp_arr["responseData"]["orders"];
|
|
|
|
|
|
|
|
for($pi=2; $pi <= $resp_arr['responseData']['pageCount']; $pi++) {
|
|
|
|
|
|
|
|
$this->tld_order->setPageIndex($pi);
|
|
|
|
|
|
|
|
$f_resp = $this->excute_curl($this->list_url, $this->tld_order);
|
|
|
|
|
|
|
|
$f_resp_arr = json_decode($f_resp, true);
|
|
|
|
|
|
|
|
if ($resp_arr['status'] !== 1) {
|
|
|
|
|
|
|
|
log_message('error','TulanduoApi get_orderlist history failed. Msg:' . $f_resp_arr['errMsg'] . "; Request: " . ($this->tld_order->getBizContent()));
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$all_list = array_merge($all_list, $f_resp_arr["responseData"]["orders"]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$all_vendor_order_id = array_column($all_list, 'orderId');
|
|
|
|
|
|
|
|
$all_vendor_order_id_str = implode(',', $all_vendor_order_id);
|
|
|
|
|
|
|
|
$exists_ht = $this->Orders_model->get_exists_vendorOrderId($all_vendor_order_id_str);
|
|
|
|
|
|
|
|
$exists_ht_order_id = array_map(function($ele){ return intval($ele->GCI_VendorOrderId);}, $exists_ht);
|
|
|
|
|
|
|
|
$to_insert = array_diff($all_vendor_order_id, $exists_ht_order_id);
|
|
|
|
|
|
|
|
var_export($to_insert);
|
|
|
|
|
|
|
|
if (empty($to_insert) || count($to_insert)==1) {
|
|
|
|
|
|
|
|
// 继续往前滚日期
|
|
|
|
|
|
|
|
$this->get_history_order_list($startTravelDate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
exit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
* 取消团
|
|
|
|
* 取消团
|
|
|
|
* @date 2018-05-02
|
|
|
|
* @date 2018-05-02
|
|
|
@ -893,7 +948,9 @@ log_message('error','in GCI ' . json_decode($resp)->responseData->orderId);
|
|
|
|
"故宫深度一日游(目的地)" => "BJSIC-44"
|
|
|
|
"故宫深度一日游(目的地)" => "BJSIC-44"
|
|
|
|
,"故宫深度游拼团(目的地)" => "BJSIC-44"
|
|
|
|
,"故宫深度游拼团(目的地)" => "BJSIC-44"
|
|
|
|
,"北京精品一日游(目的地)" => "BJSIC-41"
|
|
|
|
,"北京精品一日游(目的地)" => "BJSIC-41"
|
|
|
|
|
|
|
|
,"北京精品一日游(PVT)(目的地)" => "BJSIC-41"
|
|
|
|
,"北京精品两日游(目的地)" => "BJSIC-42"
|
|
|
|
,"北京精品两日游(目的地)" => "BJSIC-42"
|
|
|
|
|
|
|
|
,"北京精品两日游(PVT)(目的地)" => "BJSIC-42"
|
|
|
|
,"北京精品三日游(目的地)" => "BJSIC-43"
|
|
|
|
,"北京精品三日游(目的地)" => "BJSIC-43"
|
|
|
|
,"北京精品游D2(目的地)" => "BJSIC-42"
|
|
|
|
,"北京精品游D2(目的地)" => "BJSIC-42"
|
|
|
|
,"北京精品游D3(目的地)" => "BJSIC-43"
|
|
|
|
,"北京精品游D3(目的地)" => "BJSIC-43"
|
|
|
@ -903,6 +960,7 @@ log_message('error','in GCI ' . json_decode($resp)->responseData->orderId);
|
|
|
|
,"箭扣-慕田峪徒步一日游(目的地)" => "BJSIC-45"
|
|
|
|
,"箭扣-慕田峪徒步一日游(目的地)" => "BJSIC-45"
|
|
|
|
,"箭扣-慕田峪长城徒步拼团(目的地)" => "BJSIC-45"
|
|
|
|
,"箭扣-慕田峪长城徒步拼团(目的地)" => "BJSIC-45"
|
|
|
|
,"司马台西-金山岭徒步一日游(目的地)" => "BJSIC-46"
|
|
|
|
,"司马台西-金山岭徒步一日游(目的地)" => "BJSIC-46"
|
|
|
|
|
|
|
|
,"司马台西-金山岭徒步一日游(PVT)(目的地)" => "BJSIC-46"
|
|
|
|
,"司马台西-金山岭长城徒步拼团(目的地)" => "BJSIC-46"
|
|
|
|
,"司马台西-金山岭长城徒步拼团(目的地)" => "BJSIC-46"
|
|
|
|
,"慕田峪半日游拼团(目的地)" => "BJSIC-47"
|
|
|
|
,"慕田峪半日游拼团(目的地)" => "BJSIC-47"
|
|
|
|
,"古北口长城徒步一日游(目的地)" => "BJSIC-48"
|
|
|
|
,"古北口长城徒步一日游(目的地)" => "BJSIC-48"
|
|
|
@ -919,6 +977,7 @@ log_message('error','in GCI ' . json_decode($resp)->responseData->orderId);
|
|
|
|
,"上海精品一日游(目的地)" => "SHSIC-41"
|
|
|
|
,"上海精品一日游(目的地)" => "SHSIC-41"
|
|
|
|
,"上海市内精品一日游(目的地)" => "SHSIC-42"
|
|
|
|
,"上海市内精品一日游(目的地)" => "SHSIC-42"
|
|
|
|
,"周庄锦溪精品一日游(目的地)" => "SHSIC-43"
|
|
|
|
,"周庄锦溪精品一日游(目的地)" => "SHSIC-43"
|
|
|
|
|
|
|
|
,"苏州精品一日游(目的地)" => "SHSIC-44"
|
|
|
|
,"上海单租车(目的地)" => "SHSIC-45" //"SHALC-6,7,8,9"
|
|
|
|
,"上海单租车(目的地)" => "SHSIC-45" //"SHALC-6,7,8,9"
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|