trippest 同步: 海纳团不能直接关联原始团号

feature/pay
lyt 7 years ago
parent 0f75fff5a2
commit 958be04ca4

@ -171,12 +171,11 @@ class TulanduoApi extends CI_Controller
$tmpv = $this->city_info[$vo['operationDep']]['PlanVEI_SN'] ? $this->city_info[$vo['operationDep']]['PlanVEI_SN'] : 1343; $tmpv = $this->city_info[$vo['operationDep']]['PlanVEI_SN'] ? $this->city_info[$vo['operationDep']]['PlanVEI_SN'] : 1343;
// set GCI_SN // set GCI_SN
$this->Orders_model->get_SN_by_vendorOrderId($vo['orderId'], $tmpv); // 查询订单是否已经录入过 $this->Orders_model->get_SN_by_vendorOrderId($vo['orderId'], $tmpv); // 查询订单是否已经录入过
if ($this->Orders_model->BIZ_COLI_SN === null && in_array($vo['agcName'], array("D目的地桂林组", "Trippest", "桂林海纳国旅"))) { if ($this->Orders_model->BIZ_COLI_SN === null && in_array($vo['agcName'], array("D目的地桂林组", "Trippest"))) {
$real_groupCode = $this->analysis_groupCode($vo['agcOrderNo']); $real_groupCode = $this->analysis_groupCode($vo['agcOrderNo']);
// set BIZ_COLI_SN, GRI_SN at Orders_model // set BIZ_COLI_SN, GRI_SN at Orders_model
$this->Orders_model->get_SN_by_groupCode($real_groupCode, $vo['orderId']); $this->Orders_model->get_SN_by_groupCode($real_groupCode, $vo['orderId']);
} }
/** insert HT */
if ($this->Orders_model->GRI_SN === null) { if ($this->Orders_model->GRI_SN === null) {
/** GRoupInfo */ /** GRoupInfo */
$travelDate = new DateTime($vo['travelDate']); $travelDate = new DateTime($vo['travelDate']);
@ -194,6 +193,7 @@ class TulanduoApi extends CI_Controller
$this->Orders_model->GRI_Creator = 435; $this->Orders_model->GRI_Creator = 435;
$this->Orders_model->groupinfo_save(); $this->Orders_model->groupinfo_save();
} }
/** insert HT */
if ($this->Orders_model->BIZ_COLI_SN === null) { if ($this->Orders_model->BIZ_COLI_SN === null) {
/** BIZ_Guest */ /** BIZ_Guest */
$this->Orders_model->GUT_LastName = $vo['customerName']; $this->Orders_model->GUT_LastName = $vo['customerName'];

@ -513,31 +513,20 @@ class Orders_model extends CI_Model {
public function get_SN_by_groupCode($code, $vendorOrderId=NULL) public function get_SN_by_groupCode($code, $vendorOrderId=NULL)
{ {
$vendorOrderId_sql = $vendorOrderId===null ? "" : " case when GCI_VendorOrderId=$vendorOrderId then 0 else 1 end asc, "; $sql = "SELECT top 1 COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID,coli.COLI_Memo,coli.COLI_OrderDetailText,coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency
$gri_sql = "SELECT top 1 GRI_SN,GRI_OPI_ID,GRI_operator,GRI_No,GRI_Name ,GRI_OPI_ID,GRI_operator,GRI_No,GRI_Name
from GRoupInfo FROM BIZ_ConfirmLineInfo coli
left join GroupCombineInfo on GCI_GRI_SN=GRI_SN inner join BIZ_ConfirmLineDetail cold on cold.COLD_COLI_SN=COLI_SN
where GRI_Name like '%$code%' LEFT JOIN GRoupInfo gri ON coli.COLI_GRI_SN=gri.GRI_SN and GRI_OrderType=227002
order by WHERE gri.GRI_No LIKE '%$code%' "; // and gri.GRI_Name like '%$NoName%'
$vendorOrderId_sql $query = $this->HT->query($sql);
GCI_GRI_SN desc,GCI_SN asc"; if ($query->num_rows() > 0) {
$gri_query = $this->HT->query($gri_sql); $this->BIZ_COLI_SN = $query->row()->COLI_SN;
if ($gri_query->num_rows() > 0) { $this->GRI_SN = $query->row()->GRI_SN;
$this->GRI_SN = $gri_query->row()->GRI_SN; $this->GRI_No = $query->row()->GRI_No;
$this->GRI_No = $gri_query->row()->GRI_No; $this->GRI_operator = $query->row()->GRI_operator;
$this->GRI_operator = $gri_query->row()->GRI_operator; $this->COLD_PlanVEI_SN = $query->row()->COLD_PlanVEI_SN;
$coli_sql = "SELECT top 1 COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID,coli.COLI_Memo, coli.COLI_OrderDetailText,coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency return $query->row();
FROM BIZ_ConfirmLineInfo coli
inner join BIZ_ConfirmLineDetail cold on cold.COLD_COLI_SN=COLI_SN
LEFT JOIN GRoupInfo gri ON coli.COLI_GRI_SN=gri.GRI_SN
where COLI_GRI_SN=" . $this->GRI_SN;
// where COLI_GroupCode like '%$code%' ";
$coli_query = $this->HT->query($coli_sql);
if ($coli_query->num_rows() > 0) {
$this->BIZ_COLI_SN = $coli_query->row()->COLI_SN;
$this->COLD_PlanVEI_SN = $coli_query->row()->COLD_PlanVEI_SN;
}
return json_decode(json_encode(array_merge(json_decode(json_encode($gri_query->row()), true), json_decode(json_encode($coli_query->row()), true))));
} }
return NULL; return NULL;
} }
@ -1832,7 +1821,6 @@ class Orders_model extends CI_Model {
{ {
// return NULL; // return NULL;
$sql = " $sql = "
"; ";
$query = $this->HT->query($sql); $query = $this->HT->query($sql);
} }

Loading…
Cancel
Save