|
|
|
@ -341,18 +341,18 @@ class TulanduoApi extends CI_Controller
|
|
|
|
|
$getInfo_byGroupCode = $this->Orders_model->get_SN_by_groupCode($real_groupCode, $real_groupCode);
|
|
|
|
|
}
|
|
|
|
|
$groupSN = $getInfo_byGroupCode!==null ? $getInfo_byGroupCode->GRI_SN : $order->COLI_GRI_SN;
|
|
|
|
|
$coli_sn = $getInfo_byGroupCode!==null ? $getInfo_byGroupCode->COLI_SN : $order->COLI_SN;
|
|
|
|
|
$coli_id = $getInfo_byGroupCode!==null ? $getInfo_byGroupCode->COLI_ID : $order->COLI_ID;
|
|
|
|
|
$coli_memo = $getInfo_byGroupCode!==null ? $getInfo_byGroupCode->COLI_Memo : $order->COLI_Memo;
|
|
|
|
|
$coli_orderdetailtext = $getInfo_byGroupCode!==null ? $getInfo_byGroupCode->COLI_OrderDetailText : $order->COLI_OrderDetailText;
|
|
|
|
|
$coli_state = $getInfo_byGroupCode!==null ?
|
|
|
|
|
$coli_sn = isset($getInfo_byGroupCode->COLI_SN) ? $getInfo_byGroupCode->COLI_SN : $order->COLI_SN;
|
|
|
|
|
$coli_id = isset($getInfo_byGroupCode->COLI_SN) ? $getInfo_byGroupCode->COLI_ID : $order->COLI_ID;
|
|
|
|
|
$coli_memo = isset($getInfo_byGroupCode->COLI_SN) ? $getInfo_byGroupCode->COLI_Memo : $order->COLI_Memo;
|
|
|
|
|
$coli_orderdetailtext = isset($getInfo_byGroupCode->COLI_SN) ? $getInfo_byGroupCode->COLI_OrderDetailText : $order->COLI_OrderDetailText;
|
|
|
|
|
$coli_state = isset($getInfo_byGroupCode->COLI_SN) ?
|
|
|
|
|
(intval($getInfo_byGroupCode->COLI_OPI_ID)===435 ? 9 : $getInfo_byGroupCode->COLI_State)
|
|
|
|
|
: 9;
|
|
|
|
|
$cold_sn = $getInfo_byGroupCode!==null ? $getInfo_byGroupCode->COLD_SN : $order->COLD_SN;
|
|
|
|
|
$cold_sn = isset($getInfo_byGroupCode->COLI_SN) ? $getInfo_byGroupCode->COLD_SN : $order->COLD_SN;
|
|
|
|
|
// HT 订单有重复时, 以图兰朵的团号为正确的订单, 原本已录入的设为无效
|
|
|
|
|
if ($getInfo_byGroupCode === null) {
|
|
|
|
|
} elseif ($getInfo_byGroupCode->GRI_SN != $order->COLI_GRI_SN && in_array($order->GCI_FromAgc, array("D目的地桂林组", "Trippest"))) {
|
|
|
|
|
if ( $order->COLI_ID) {
|
|
|
|
|
if ( $order->COLI_ID && $order->COLI_ID != $getInfo_byGroupCode->COLI_ID) {
|
|
|
|
|
$allDetails_to_HT .= "\r\n疑似重复,请更新订单状态:" . $order->COLI_ID;
|
|
|
|
|
if (intval($order->COLI_OPI_ID) === 435 ) {
|
|
|
|
|
$this->order_cancel($order->COLI_ID);
|
|
|
|
@ -386,10 +386,10 @@ class TulanduoApi extends CI_Controller
|
|
|
|
|
}
|
|
|
|
|
unset($vtf);
|
|
|
|
|
}
|
|
|
|
|
$travel_fee = $getInfo_byGroupCode!==null ?
|
|
|
|
|
$travel_fee = isset($getInfo_byGroupCode->COLI_SN) ?
|
|
|
|
|
(intval($getInfo_byGroupCode->COLI_OPI_ID)===435 ? $travel_fee : $getInfo_byGroupCode->COLI_Price)
|
|
|
|
|
: $travel_fee;
|
|
|
|
|
$travel_fee_currency = $getInfo_byGroupCode!==null ?
|
|
|
|
|
$travel_fee_currency = isset($getInfo_byGroupCode->COLI_SN) ?
|
|
|
|
|
(intval($getInfo_byGroupCode->COLI_OPI_ID)===435 ? $travel_fee_currency : $getInfo_byGroupCode->COLI_CUrrency)
|
|
|
|
|
: $travel_fee_currency;
|
|
|
|
|
$coli_update_column = array(
|
|
|
|
@ -401,16 +401,20 @@ class TulanduoApi extends CI_Controller
|
|
|
|
|
);
|
|
|
|
|
$this->Order_update->biz_confirmlineinfo_update($coli_update_column);
|
|
|
|
|
/** BIZ_ConfirmLineDetail */ // nothing to update
|
|
|
|
|
// query latest order detail
|
|
|
|
|
$latest_order_detail = $this->Orders_model->get_orderinfo_detail($coli_id);
|
|
|
|
|
/** INSERT */
|
|
|
|
|
/*BIZ_BookPeople*/
|
|
|
|
|
if ($this->Orders_model->bookpeople_exist($cold_sn) === array()) {
|
|
|
|
|
foreach ($detail_jsonResp->orderDetail->customers as $kd => $vd) {
|
|
|
|
|
$this->Orders_model->BPE_FirstName = $vd->name;
|
|
|
|
|
$this->Orders_model->BPE_GuestType = $vd->peopleType=="成人" ? 1 : 2;
|
|
|
|
|
$this->Orders_model->BPE_Passport = $vd->documentNo;
|
|
|
|
|
$bpe_sn[] = $this->Orders_model->biz_book_people_save();
|
|
|
|
|
// BIZ_BookPeopleList
|
|
|
|
|
$this->Orders_model->biz_bookpeople_List_save($cold_sn, $this->Orders_model->BPE_SN);
|
|
|
|
|
if (isset($detail_jsonResp->orderDetail->customers)) {
|
|
|
|
|
foreach ($detail_jsonResp->orderDetail->customers as $kd => $vd) {
|
|
|
|
|
$this->Orders_model->BPE_FirstName = $vd->name;
|
|
|
|
|
$this->Orders_model->BPE_GuestType = $vd->peopleType=="成人" ? 1 : 2;
|
|
|
|
|
$this->Orders_model->BPE_Passport = $vd->documentNo;
|
|
|
|
|
$bpe_sn[] = $this->Orders_model->biz_book_people_save();
|
|
|
|
|
// BIZ_BookPeopleList
|
|
|
|
|
$this->Orders_model->biz_bookpeople_List_save($cold_sn, $this->Orders_model->BPE_SN);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*BIZ_PackageOrderInfo*/
|
|
|
|
@ -429,7 +433,7 @@ class TulanduoApi extends CI_Controller
|
|
|
|
|
$auto_text = "dataAutoEnter ";
|
|
|
|
|
// 删除旧的录入
|
|
|
|
|
$this->Orders_model->biz_groupaccountinfo_cut($coli_sn, $paytype);
|
|
|
|
|
if (isset($detail_jsonResp->orderDetail->travelFees) && ! in_array($order->GCI_FromAgc, array("D目的地桂林组", "Trippest")) ) {
|
|
|
|
|
if (isset($detail_jsonResp->orderDetail->travelFees) && intval($latest_order_detail[0]->COLI_OPI_ID===435) ) {
|
|
|
|
|
foreach ($detail_jsonResp->orderDetail->travelFees as $ktf => $vtf) {
|
|
|
|
|
// if ($vtf->reviewStatus == 0) { // 未审核的
|
|
|
|
|
// continue;
|
|
|
|
@ -449,7 +453,7 @@ class TulanduoApi extends CI_Controller
|
|
|
|
|
}
|
|
|
|
|
// 目的地项目组的订单为了避免重复录入, 外联会沟通录入, 这里不写入. todo
|
|
|
|
|
// 代收
|
|
|
|
|
if (isset($detail_jsonResp->orderDetail->replaceCollections) && ! in_array($order->GCI_FromAgc, array("D目的地桂林组", "Trippest")) ) {
|
|
|
|
|
if (isset($detail_jsonResp->orderDetail->replaceCollections) && intval($latest_order_detail[0]->COLI_OPI_ID===435) ) {
|
|
|
|
|
foreach ($detail_jsonResp->orderDetail->replaceCollections as $krc => $vrc) {
|
|
|
|
|
// if ($vrc->reviewStatus == 0) {
|
|
|
|
|
// continue;
|
|
|
|
@ -468,7 +472,7 @@ class TulanduoApi extends CI_Controller
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 代付
|
|
|
|
|
if (isset($detail_jsonResp->orderDetail->replacePays) && ! in_array($order->GCI_FromAgc, array("D目的地桂林组", "Trippest")) ) {
|
|
|
|
|
if (isset($detail_jsonResp->orderDetail->replacePays) && intval($latest_order_detail[0]->COLI_OPI_ID===435) ) {
|
|
|
|
|
foreach ($detail_jsonResp->orderDetail->replacePays as $krp => $vrp) {
|
|
|
|
|
// if ($vrp->reviewStatus == 0) {
|
|
|
|
|
// continue;
|
|
|
|
@ -830,7 +834,9 @@ log_message('error','in GCI ' . json_decode($resp)->responseData->orderId);
|
|
|
|
|
$temp_array[0] = strrchr($temp_array[0], " ") ? mb_strstr($temp_array[0], " ",true) : $temp_array[0];
|
|
|
|
|
$tmp_groupCode = explode("-", trim($temp_array[0]));
|
|
|
|
|
$real_groupCode = $tmp_groupCode[0] . "-";
|
|
|
|
|
$real_groupCode .= mb_strstr($tmp_groupCode[1], "(", true)!==false ? mb_strstr($tmp_groupCode[1], "(", true) : $tmp_groupCode[1];
|
|
|
|
|
if (isset($tmp_groupCode[1])) {
|
|
|
|
|
$real_groupCode .= mb_strstr($tmp_groupCode[1], "(", true)!==false ? mb_strstr($tmp_groupCode[1], "(", true) : $tmp_groupCode[1];
|
|
|
|
|
}
|
|
|
|
|
$real_groupCode = mb_ereg_replace('( )', '', trim($real_groupCode));
|
|
|
|
|
return $real_groupCode;
|
|
|
|
|
}
|
|
|
|
|