trippest 查询model
parent
8774adaf1f
commit
acb8fcafa9
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
/*!
|
||||
* 查询
|
||||
*/
|
||||
|
||||
class Orders_query extends CI_Model {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->HT = $this->load->database('HT', TRUE);
|
||||
}
|
||||
|
||||
/** 获取海纳团的发团人 */
|
||||
public function get_gri_opi_id($code)
|
||||
{
|
||||
$gri_sql = "SELECT top 1 GRI_SN,GRI_OPI_ID,isnull(GRI_operator,0) GRI_operator,GRI_No,GRI_Name
|
||||
from GRoupInfo
|
||||
where GRI_Name like '%$code%' ";
|
||||
$gri_query = $this->HT->query($gri_sql);
|
||||
if ($gri_query->num_rows() > 0) {
|
||||
return $gri_query->row()->GRI_operator;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function get_package_order($COLI_ID)
|
||||
{
|
||||
$order_info_sql = "SELECT
|
||||
GCI_SN,GCI_VendorOrderId,GCI_combineNo
|
||||
,COLI_SN,COLI_ID,COLD_SN,COLI_GroupCode,COLI_OPI_ID,COLI_OrderDetailText
|
||||
,COLD_ServiceSN,COLD_PersonNum,COLD_ChildNum,COLD_StartDate,COLD_EndDate,cold.COLD_MemoText
|
||||
,pags.PAGS_Direction,pags.PAGS_describ
|
||||
,pag2.PAG2_Name
|
||||
,poi.POI_Hotel,poi.POI_HotelAddress,poi.POI_HotelPhone
|
||||
,poi.POI_AirPort,poi.POI_FlightsNo
|
||||
,GUT_FirstName,GUT_LastName
|
||||
FROM BIZ_ConfirmLineInfo coli
|
||||
inner join GroupCombineInfo on COLI_GRI_SN=GCI_GRI_SN --and GCI_combineNo<>'cancel'
|
||||
inner join BIZ_ConfirmLineDetail cold on COLD_COLI_SN=COLI_SN
|
||||
inner join BIZ_PackageOrderInfo poi on poi.POI_COLD_SN=COLD_SN
|
||||
inner join BIZ_GUEST g on g.GUT_SN=COLI_GUT_SN
|
||||
inner join BIZ_PackageInfo2 pag2 on pag2.PAG2_PAG_SN=COLD_ServiceSN and pag2.PAG2_LGC=1
|
||||
left join BIZ_PackageInfoSub pags on pags.PAGS_SN=cold.COLD_ServiceSN2
|
||||
where COLI_GroupCode like '%" . $this->HT->escape_like_str($COLI_ID) . "%'
|
||||
OR COLI_ID like '%" . $this->HT->escape_like_str($COLI_ID) . "%'
|
||||
order by COLD_StartDate asc";
|
||||
// OR COLI_ID like '%" . $this->HT->escape_like_str($COLI_ID) . "%'
|
||||
$order_info_query = $this->HT->query($order_info_sql);
|
||||
$ret = $order_info_query->result();
|
||||
// if ($order_info_query->num_rows() > 0) {
|
||||
// $operation_sql = "SELECT gcod.*
|
||||
// from GroupCombineOperationDetail gcod
|
||||
// where GCOD_GCI_combineNo=?
|
||||
// and gcod.GCOD_operationType in ('touristCarOperations','guiderOperations')";
|
||||
// $operation_info = $this->HT->query($operation_sql, array($ret['order_info'][0]->GCI_combineNo));
|
||||
// $ret['operation_info'] = $operation_info->result();
|
||||
// }
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function get_operator($OPI_SN=0)
|
||||
{
|
||||
$operator_sql = "SELECT opi.OPI_SN,opi.OPI_Name,opi.OPI_FirstName,OPI_MoveTelephone,OPI_Email,opi2.OPI2_Name
|
||||
from OperatorInfo opi
|
||||
left join OperatorInfo2 opi2 on opi2.OPI2_OPI_SN=OPI_SN and opi2.OPI2_LGC=1
|
||||
where OPI_SN=" . $OPI_SN . " AND OPI_SN<>435";
|
||||
return $this->HT->query($operator_sql)->row();
|
||||
}
|
||||
|
||||
function get_operation($combineNo)
|
||||
{
|
||||
$combineNos = my_implode("'",",",$combineNo);
|
||||
$operation_sql = "SELECT gcod.*
|
||||
from GroupCombineOperationDetail gcod
|
||||
where GCOD_GCI_combineNo in ($combineNos)
|
||||
and gcod.GCOD_operationType in ('touristCarOperations','guiderOperations')
|
||||
order by GCOD_startDate";
|
||||
$operation_info = $this->HT->query($operation_sql, array($combineNo));
|
||||
return $operation_info->result();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue