Merge branch 'feature/plan-auto-send-release' into feature/plan-auto-send

hotfix/远程访问多媒体中心
lyt 6 years ago
commit 6639ba83e9

@ -24,9 +24,9 @@ class Index extends CI_Controller {
* * 使用供应商平台登陆账号获取接口的key * * 使用供应商平台登陆账号获取接口的key
*/ */
public function index($GRI_SN=0) public function index($GRI_SN=0, $vendor=null)
{ {
$auto_vendor_str = implode(",", $this->vendor->auto_vendor); $auto_vendor_str = $vendor===null ? implode(",", $this->vendor->auto_vendor) : $vendor;
return $this->push($GRI_SN, $auto_vendor_str); return $this->push($GRI_SN, $auto_vendor_str);
} }

@ -128,7 +128,6 @@ class Tulanduo
$grd_apart_info = $this->tour_apart($grd_info); $grd_apart_info = $this->tour_apart($grd_info);
$big_order_index = 0; $big_order_index = 0;
$expect_order_cnt = count($grd_apart_info['com'])+intval(!empty($grd_apart_info['big_pvt']))+intval(!empty($grd_apart_info['pvt'])); $expect_order_cnt = count($grd_apart_info['com'])+intval(!empty($grd_apart_info['big_pvt']))+intval(!empty($grd_apart_info['pvt']));
// echo json_encode($grd_info);exit;
foreach ($grd_apart_info as $group_key => $grd_a) { foreach ($grd_apart_info as $group_key => $grd_a) {
$big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, $guestlist, $grd_a, $big_order_index); $big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, $guestlist, $grd_a, $big_order_index);
} }
@ -151,11 +150,18 @@ class Tulanduo
} }
$userId = $this->send_host["1"]["userId"]; $userId = $this->send_host["1"]["userId"];
$userKey = $this->send_host["1"]["key"]; $userKey = $this->send_host["1"]["key"];
$destination = $grd['details'][0]->tocity;
$destination_code = $grd['details'][0]->citycode;
if (empty($destination)) {
$vendor_city = $this->Group_model->get_vendor_city($vas->VAS_VEI_SN);
$destination = $vendor_city->cityname;
$destination_code = $vendor_city->citycode;
}
switch ($group_type) { switch ($group_type) {
case 'big_pvt': case 'big_pvt':
$total_order_index ++; $total_order_index ++;
$all_grd = array($grd); $all_grd = array($grd);
$routeName = "中华游" . $grd['details'][0]->tocity . "常规线路"; $routeName = "中华游" . $destination . "常规线路";
$routeType = $routeName; $routeType = $routeName;
$agcOrderNo = $vas->GRI_Name; $agcOrderNo = $vas->GRI_Name;
// $agcOrderNo .= "(" . $vas->operator . ")"; // $agcOrderNo .= "(" . $vas->operator . ")";
@ -166,7 +172,7 @@ class Tulanduo
$all_grd = array($grd); $all_grd = array($grd);
$routeName = empty($grd['details'][0]->GRD_Landscape) ? $grd['details'][0]->PAG_Title : $grd['details'][0]->GRD_Landscape; $routeName = empty($grd['details'][0]->GRD_Landscape) ? $grd['details'][0]->PAG_Title : $grd['details'][0]->GRD_Landscape;
$routeName .= "(" . $grd['details'][0]->PAG_Code . ")"; $routeName .= "(" . $grd['details'][0]->PAG_Code . ")";
$routeType = $grd['details'][0]->tocity . "目的地线路"; $routeType = $destination . "目的地线路";
$agcOrderNo = $vas->GRI_Name; $agcOrderNo = $vas->GRI_Name;
// $agcOrderNo .= "(" . $vas->operator . ")"; // $agcOrderNo .= "(" . $vas->operator . ")";
$order_type = 1; $order_type = 1;
@ -184,7 +190,7 @@ class Tulanduo
if (empty($routeName)) { if (empty($routeName)) {
$routeName = $vo['details'][0]->GRD_Landscape . "(" . $vo['details'][0]->PAG_Code . ")"; $routeName = $vo['details'][0]->GRD_Landscape . "(" . $vo['details'][0]->PAG_Code . ")";
} }
$routeType = $vo['details'][0]->tocity . "目的地线路"; $routeType = $destination . "目的地线路";
$agcOrderNo = $vas->GRI_Name; $agcOrderNo = $vas->GRI_Name;
// $agcOrderNo .= "(" . $vas->operator . ")"; // $agcOrderNo .= "(" . $vas->operator . ")";
} }
@ -200,24 +206,35 @@ class Tulanduo
->setAgcOrderNo($agcOrderNo) ->setAgcOrderNo($agcOrderNo)
->setAdultNum(intval($vo['details'][0]->ACI_PersonNum)) ->setAdultNum(intval($vo['details'][0]->ACI_PersonNum))
->setChildNum(intval(bcadd($vo['details'][0]->ACI_ChildNum, $vo['details'][0]->ACI_BabyNum))) ->setChildNum(intval(bcadd($vo['details'][0]->ACI_ChildNum, $vo['details'][0]->ACI_BabyNum)))
->setDestination($vo['details'][0]->tocity) ->setDestination($destination)
->setTravelDate($first_date) ->setTravelDate($first_date)
->setLeavedDate($end_date) ->setLeavedDate($end_date)
// ->setOrderRemark($order_remark) // 订单备注 TODO: // ->setOrderRemark($order_remark) // 订单备注 TODO:
// ->setRoomStandard($request_info->GCI_HotelRequest) // 住房标准 // ->setRoomStandard($request_info->GCI_HotelRequest) // 住房标准
->setRouteStandard($request_info->GCI_Request) // 行程服务标准 ->setRouteStandard($request_info->GCI_Request) // 行程服务标准
; ;
$from_country = ""; // 客源地
if ($guestlist===null) { if ($guestlist===null) {
$g_cold_str = array_map(function ($ele){return $ele->GRD_COLD_SN;}, $vo['details']); $g_cold_str = array_map(function ($ele){return $ele->GRD_COLD_SN;}, $vo['details']);
$guestlist = $this->ci->BIZ_order->get_guestlist(implode(',',$g_cold_str)); $guestlist = $this->ci->BIZ_order->get_guestlist(implode(',',$g_cold_str));
$from_country = current(array_filter(array_map(function ($ele){return $ele->Country;},$guestlist)));
if (strval($from_country)==='') {
$biz_contact = $this->ci->BIZ_order->get_customer_contact(implode(',',$g_cold_str));
$from_country = $biz_contact->Country;
}
} }
foreach ($guestlist as $key => $vg) { foreach ($guestlist as $key => $vg) {
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName ) $this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
->setCustomersPeopleType($key, (calc_age_type($vg->BirthDay)==1 ? "成人" : "儿童")) ->setCustomersPeopleType($key, (calc_age_type($vg->BirthDay)==1 ? "成人" : "儿童"))
->setCustomersDocumentType($key, "护照") // Passport No. ->setCustomersDocumentType($key, "护照") // Passport No.
->setCustomersDocumentNo($key, $vg->PassportNo) ->setCustomersDocumentNo($key, $vg->PassportNo)
->setCustomersOtherInfo($key, $vg->Country . "; " . $vg->phone); ->setCustomersPhoneNo($key, $vg->phone);
if (strval($vg->Country) !== '' && strval($from_country) === '') {
$from_country = $vg->Country;
}
} }
// 客源地
$this->ci->tldOrderBuilder->setCustomerFromCity($from_country);
// 补全空的日期,行程为空 // 补全空的日期,行程为空
$date1 = new DateTime($first_date); $date1 = new DateTime($first_date);
$date_end = new DateTime($end_date); $date_end = new DateTime($end_date);
@ -306,10 +323,14 @@ class Tulanduo
* ) * )
* ) * )
*/ */
public function tour_apart($all_pag_info, $need_complete=false) public function tour_apart($all_pag_info)
{ {
$apart = array(); $ret = array(); $apart = array(); $ret = array();
foreach ($all_pag_info as $key => $pag) { foreach ($all_pag_info as $key => $pag) {
if ( ! isset($pag->PAG_DEI_SN)) {
// 通宵火车或其他, 不含该社行程
continue;
}
// CH下的产品编号修正 // CH下的产品编号修正
if (intval($pag->PAG_DEI_SN)===1 && ! empty($pag->PAG_Code)) { if (intval($pag->PAG_DEI_SN)===1 && ! empty($pag->PAG_Code)) {
$pag->PAG_Code = $this->ci->trippest->ch_code_transfer( mb_strtoupper($pag->PAG_Code)); $pag->PAG_Code = $this->ci->trippest->ch_code_transfer( mb_strtoupper($pag->PAG_Code));
@ -402,17 +423,18 @@ class Tulanduo
} }
if ( ! empty($train_coldsn_arr)) { if ( ! empty($train_coldsn_arr)) {
$route_name .= $route_name==="" ? "" : "+"; $route_name .= $route_name==="" ? "" : "+";
$route_name .= "火车票预订"; $route_name .= "单订国际列车票服务";
$order_type = 1; $order_type = 1;
$train_order = $this->ci->BIZ_order->get_train_flight_order(implode(',', $train_coldsn_arr)); $train_order = $this->ci->BIZ_order->get_train_flight_order(implode(',', $train_coldsn_arr));
$agcOrderNo = $vas->GRI_Name; $agcOrderNo = $vas->GRI_Name;
$last_date = count($train_order)-1; $last_date = count($train_order)-1;
$end_date = strstr($train_order[$last_date]->COLD_EndDate, " ", true); $end_date = strstr($train_order[$last_date]->COLD_EndDate, " ", true);
$end_date = $end_date ? $end_date : strstr($train_order[0]->COLD_StartDate, " ", true);
$this->ci->tldOrderBuilder->setUserId($userId) $this->ci->tldOrderBuilder->setUserId($userId)
->setKey($userKey) ->setKey($userKey)
->setOrderType($order_type) ->setOrderType($order_type)
->setRouteName($route_name) ->setRouteName($route_name)
->setRouteType("火车票预订") ->setRouteType("单订国际列车票服务")
->setAgcOrderNo($agcOrderNo) ->setAgcOrderNo($agcOrderNo)
->setAdultNum($train_order[0]->adult_num) ->setAdultNum($train_order[0]->adult_num)
->setChildNum($train_order[0]->child_num) ->setChildNum($train_order[0]->child_num)
@ -422,14 +444,18 @@ class Tulanduo
; ;
$train_guest_list = $this->ci->BIZ_order->get_guestlist(implode(',', $train_coldsn_arr)); $train_guest_list = $this->ci->BIZ_order->get_guestlist(implode(',', $train_coldsn_arr));
// 客人列表 // 客人列表
$from_country = ""; // 客源地
foreach ($train_guest_list as $key => $vg) { foreach ($train_guest_list as $key => $vg) {
$this_otherinfo = ""; // $this_otherinfo = "";
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName ) $this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童")) ->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
->setCustomersDocumentType($key, "护照") // Passport No. ->setCustomersDocumentType($key, "护照") // Passport No.
->setCustomersDocumentNo($key, $vg->BPE_Passport) ->setCustomersDocumentNo($key, $vg->PassportNo)
; ;
$this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality); if (strval($vg->Country) !== '' && strval($from_country) === '') {
$from_country = $vg->Country;
}
// $this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality);
// todo:电话 // todo:电话
// if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) { // if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
// $this_otherinfo .= "; 电话:"; // $this_otherinfo .= "; 电话:";
@ -438,6 +464,7 @@ class Tulanduo
// $this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo); // $this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
// } // }
} }
$this->ci->tldOrderBuilder->setCustomerFromCity($from_country);
$s_index = 0; $s_index = 0;
foreach ($train_order as $train) { foreach ($train_order as $train) {
$this_content = ''; $this_content = '';
@ -454,6 +481,7 @@ class Tulanduo
$s_index++; $s_index++;
} }
$this->ci->tldOrderBuilder->clearModifyLogInfo(); $this->ci->tldOrderBuilder->clearModifyLogInfo();
// echo $this->ci->tldOrderBuilder->getBizContent();exit;
$resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder); $resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder);
$response = json_decode($resp); $response = json_decode($resp);
$sync_orderstate = 10; $sync_orderstate = 10;
@ -479,7 +507,6 @@ class Tulanduo
/** VendorArrangeState VAS_IsReceive */ /** VendorArrangeState VAS_IsReceive */
$this->ci->Group_model->set_plan_received($vas_sn); $this->ci->Group_model->set_plan_received($vas_sn);
} }
echo ($this->ci->tldOrderBuilder->getBizContent());
} }
if ( ! empty($pag_coldsn_arr)) { if ( ! empty($pag_coldsn_arr)) {
$this->biz_pag_order_exec($vas,$grd_info); $this->biz_pag_order_exec($vas,$grd_info);
@ -559,9 +586,14 @@ class Tulanduo
// echo json_encode($grd_apart_info);exit; // echo json_encode($grd_apart_info);exit;
$request_info = $this->ci->Group_model->get_plan_request($vas->GRI_SN); $request_info = $this->ci->Group_model->get_plan_request($vas->GRI_SN);
$big_order_index = 0; $big_order_index = 0;
$expect_order_cnt = count($grd_apart_info['com'])+intval(!empty($grd_apart_info['big_pvt']))+intval(!empty($grd_apart_info['pvt']));
foreach ($grd_apart_info as $group_key => $grd_part) { foreach ($grd_apart_info as $group_key => $grd_part) {
$big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, null, $grd_part, $big_order_index); $big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, null, $grd_part, $big_order_index);
} }
if ($big_order_index === $expect_order_cnt) {
/** VendorArrangeState VAS_IsReceive */
$this->ci->Group_model->set_plan_received($vas->VAS_SN);
}
} }
/*! /*!
@ -695,21 +727,28 @@ class Tulanduo
// ->setBackTraffic($backTraffic) // ->setBackTraffic($backTraffic)
; ;
// 客人列表 // 客人列表
$from_country = '';
foreach ($guestlist as $key => $vg) { foreach ($guestlist as $key => $vg) {
$this_otherinfo = ""; $this_otherinfo = "";
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName ) $this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童")) ->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
->setCustomersDocumentType($key, "护照") // Passport No. ->setCustomersDocumentType($key, "护照") // Passport No.
->setCustomersDocumentNo($key, $vg->BPE_Passport) ->setCustomersDocumentNo($key, $vg->PassportNo)
; ;
$this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality);
if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) { if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
$this_otherinfo .= "; 电话:";
$this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ; $this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ;
$this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL); $this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL);
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo); $this->ci->tldOrderBuilder->setCustomersPhoneNo($key, $this_otherinfo);
}
if (strval($from_country) === '' && strval($vg->Country) !== '') {
$from_country = $vg->Country;
} }
} }
if (strval($from_country)==='') {
$biz_contact = $this->ci->BIZ_order->get_customer_contact($COLD_SN_str);
$from_country = $biz_contact->Country;
}
$this->ci->tldOrderBuilder->setCustomerFromCity($from_country);
$scheduleDetails = $this->ci->BIZ_order->get_scheduleDetails($COLD_SN_str); $scheduleDetails = $this->ci->BIZ_order->get_scheduleDetails($COLD_SN_str);
$schedule_obj = array(); $schedule_obj = array();
foreach ($scheduleDetails as $ks => $vs) { foreach ($scheduleDetails as $ks => $vs) {
@ -893,7 +932,7 @@ class Tulanduo
$this->ci->BIZ_order->insert_biz_order_log($coli_sn, "vendorPlanUpdateSendout_" . $tour_code); $this->ci->BIZ_order->insert_biz_order_log($coli_sn, "vendorPlanUpdateSendout_" . $tour_code);
} }
/** VendorArrangeState VAS_IsReceive */ /** VendorArrangeState VAS_IsReceive */
$this->ci->Group_model->set_plan_received($vas_sn); $this->ci->Group_model->set_plan_received($vas_sn, $gri_sn);
} }
} }
return "[Tulanduo>push_trippest] Done. " . $COLI_ID; return "[Tulanduo>push_trippest] Done. " . $COLI_ID;

@ -385,4 +385,30 @@ return ;
where p.PAGS_SN=$PAGS_SN "; where p.PAGS_SN=$PAGS_SN ";
return $this->HT->query($sql)->row(); return $this->HT->query($sql)->row();
} }
/*!
* @Author: LYT
* @Date: 2019-06-25 10:12:52
* @Desc: 商务订单联系人信息
*/
public function get_customer_contact($COLD_SN_str)
{
$sql = "SELECT
GUT_FirstName + ' '+GUT_LastName as MemberName,
'' as BirthDay,
'' as Gender,
GUT_MoveTel as phone,
(select COI2_Country from V_Country_Info
where LGC_LGC = 2
and COI_SN = GUT_NationalityID
) as Country,
GUT_Passport as PassportNo,
'' as PassportValidDate
--,BIZ_GUEST.*
from BIZ_GUEST
inner join BIZ_ConfirmLineInfo on COLI_GUT_SN=GUT_SN
inner join BIZ_ConfirmLineDetail on COLI_SN=COLD_COLI_SN
where COLD_SN IN ($COLD_SN_str) ";
return $this->HT->query($sql)->row();
}
} }

@ -26,7 +26,10 @@ class Group_model extends CI_Model {
AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0 AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0
-- AND EOI_GetDate between '$start_date' AND '$end_date' -- AND EOI_GetDate between '$start_date' AND '$end_date'
AND EOI_GetDate > CONVERT(date, GETDATE()) AND EOI_GetDate > CONVERT(date, GETDATE())
AND isnull(VAS_IsConfirm,0)=0 AND isnull(VAS_SendVary,0)=0 AND isnull(VAS_IsConfirm,0)=0 AND VAS_ConfirmSN IS NULL
and not exists (
select 1 from VendorPlanSendout where VPS_VAS_SN=VAS_SN
)
"; ";
$sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc"; $sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc";
return $this->HT->query($sql)->result(); return $this->HT->query($sql)->result();
@ -94,7 +97,7 @@ class Group_model extends CI_Model {
$vgrd->ACI_PersonNum = intval($vaci->ACI_PersonNum); $vgrd->ACI_PersonNum = intval($vaci->ACI_PersonNum);
$vgrd->ACI_ChildNum = intval($vaci->ACI_ChildNum); $vgrd->ACI_ChildNum = intval($vaci->ACI_ChildNum);
$vgrd->ACI_BabyNum = intval($vaci->ACI_BabyNum); $vgrd->ACI_BabyNum = intval($vaci->ACI_BabyNum);
$vgrd->PAG_DEI_SN = $vaci->PAG_DEI_SN; $vgrd->PAG_DEI_SN = $vaci->PAG_DEI_SN ? $vaci->PAG_DEI_SN : 0;
if ( strval($vaci->ACI_ServiceType)==='D') { if ( strval($vaci->ACI_ServiceType)==='D') {
$vgrd->PAG_Code = mb_strtoupper($vaci->PAG_Code); $vgrd->PAG_Code = mb_strtoupper($vaci->PAG_Code);
$vgrd->PAG_ExtendType = mb_strtoupper($vaci->PAG_ExtendType); $vgrd->PAG_ExtendType = mb_strtoupper($vaci->PAG_ExtendType);
@ -119,7 +122,7 @@ class Group_model extends CI_Model {
$vgrd->ACI_BabyNum = intval($vcold->COLD_BabyNum); $vgrd->ACI_BabyNum = intval($vcold->COLD_BabyNum);
$vgrd->PAG_DEI_SN = $vcold->PAG_DEI_SN; $vgrd->PAG_DEI_SN = $vcold->PAG_DEI_SN;
$vgrd->PAG_sub_sn = intval($vcold->COLD_ServiceSN2); $vgrd->PAG_sub_sn = intval($vcold->COLD_ServiceSN2);
$vgrd->vendor_memo = trim($vcold->COLD_VendorMemo); $vgrd->vendor_memo = trim($vcold->COLD_vendorMemo);
if ( strval($vcold->COLD_ServiceType)==='D') { if ( strval($vcold->COLD_ServiceType)==='D') {
$vgrd->PAG_Code = mb_strtoupper($vcold->PAG_Code); $vgrd->PAG_Code = mb_strtoupper($vcold->PAG_Code);
$vgrd->PAG_ExtendType = mb_strtoupper($vcold->PAG_ExtendType); $vgrd->PAG_ExtendType = mb_strtoupper($vcold->PAG_ExtendType);
@ -291,10 +294,13 @@ class Group_model extends CI_Model {
return $eva_g_sn; return $eva_g_sn;
} }
public function set_plan_received($vas_sn=0) public function set_plan_received($vas_sn=0, $gri_sn=null)
{ {
$sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=? "; $sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=$vas_sn ";
return $this->HT->query($sql, array($vas_sn)); if ($gri_sn !== null) {
$sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_GRI_SN=$gri_sn ";
}
return $this->HT->query($sql);
} }
/*! /*!
@ -358,6 +364,65 @@ class Group_model extends CI_Model {
return $query; return $query;
} }
public function get_vendor_city($vei_sn)
{
$sql = "SELECT
CII_PKCode citycode,CII2_Name cityname
from VEndorInfo
inner join CItyInfo on CII_SN=VEI_CII_Name
inner join CItyInfo2 on CII2_CII_SN=VEI_CII_Name and CII2_LGC=2
where VEI_SN=? ";
return $this->HT->query($sql, array($vei_sn))->row();
}
/*!
* @Author: LYT
* @Date: 2019-06-25 14:56:01
* @Desc: 生成计划最后的导游备注
* @return PHP ArrayObject
*/
public function get_plan_remark($gri_sn, $vei_sn)
{
$sql = "DECLARE @StrResult varchar(1000);SET NOCOUNT ON;
EXEC SP_VendorPlan_GetAddFeeProduct $gri_sn, $vei_sn, @StrResult out
SELECT @StrResult as remark
";
$result_obj = $this->call_sp_fun($sql);
return empty($result_obj) ? '' : $result_obj[0]->remark;
}
public function call_sp_fun($sql)
{
// SET NOCOUNT ON 才能这样调用, 否则需要遍历结果集
// $sql = " Tourmanager.dbo.SP_VendorPlan_GetPlanInfo ?, ?, 0 ";
// $grd_info = $this->HT->query($sql, array($gri_sn, $vendor_id))->result();
include('c:/database_conn.php');
$connection = array(
'UID' => $db['HT']['username'],
'PWD' => $db['HT']['password'],
'Database' => 'tourmanager',
'ConnectionPooling' => 1,
'CharacterSet' => 'utf-8',
'ReturnDatesAsStrings' => 1
);
$conn = sqlsrv_connect($db['HT']['hostname'], $connection);
$stmt = sqlsrv_query($conn, $sql);
$result_object = array();
if (false !== $stmt ) { // 无权限或执行错误返回false
// 存储过程中每个select都产生结果集
// 设置了SET NOCOUNT ON;就只有输出的结果集
$a = true;
while ($a !== false) {
$row = sqlsrv_fetch_object($stmt); // Retrieves the next row of data as a PHP object.
$a = !empty($row);
$a===true ? $result_object[] = $row : null;
}
sqlsrv_free_stmt($stmt);
}
sqlsrv_close($conn);
return $result_object;
}
} }
/* End of file Group_model.php */ /* End of file Group_model.php */

@ -128,7 +128,7 @@ class TuLanDuo_addOrUpdateRouteOrderContentBuilder extends CI_Model
} }
public function setRouteStandard($routeStandard) public function setRouteStandard($routeStandard)
{ {
$this->orderData['routeStandard'] = $routeStandard; $this->orderData['routeStandard'] = "该团按非购物团标准结算 要求/接团小技巧:\r\n" . $routeStandard;
return $this; return $this;
} }
public function setDestination($destination) public function setDestination($destination)
@ -146,6 +146,16 @@ class TuLanDuo_addOrUpdateRouteOrderContentBuilder extends CI_Model
$this->orderData['leavedDate'] = $leavedDate; $this->orderData['leavedDate'] = $leavedDate;
return $this; return $this;
} }
public function setOperationUserName($operationUserName)
{
$this->orderData['operationUserName'] = $operationUserName;
return $this;
}
public function setCustomerFromCity($customerFromCity)
{
$this->orderData['customerFromCity'] = $customerFromCity;
return $this;
}
/** 团款数组 */ /** 团款数组 */
public function setTravelFeesType($index, $type) public function setTravelFeesType($index, $type)

Loading…
Cancel
Save