tracking: 北京两/三日游产品显示名称修改; 显示日期范围

feature/trippest
lyt 8 years ago
parent 4073dc449c
commit ab361415e8

@ -7,6 +7,7 @@ class Api extends CI_Controller {
parent::__construct();
mb_regex_encoding("UTF-8");
$this->load->helper('array');
$this->load->library('trippest');
$this->load->model('Orders_query', 'Orders_model');
}
@ -60,6 +61,7 @@ class Api extends CI_Controller {
$ret['operation'][$value->GCOD_startDate]['cardriver'][] = $tmp_car;
// 出团时间
$ret['operation'][$value->GCOD_startDate]['start_date'] = $value->GCOD_startDate;
$ret['operation'][$value->GCOD_startDate]['end_date'] = $value->GCOD_endDate;
}
else if ($value->GCOD_operationType === 'guiderOperations') {
$tmp_g = array();
@ -72,19 +74,25 @@ class Api extends CI_Controller {
$ret['operation'][$value->GCOD_startDate]['tourguide'][] = $tmp_g;
// 出团时间
$ret['operation'][$value->GCOD_startDate]['start_date'] = $value->GCOD_startDate;
$ret['operation'][$value->GCOD_startDate]['end_date'] = $value->GCOD_endDate;
}
}
// 加上行程
$num_index = 0;
foreach ($ret['operation'] as $kro => &$vro) {
$vro['start_date_raw'] = $vro['start_date'];
$out_datetime = strtotime($vro['start_date']);
$out_datetime2 = strtotime($vro['end_date']);
$vro['dateWeek_text'] = date('D', $out_datetime);
$vro['dateDay_text'] = date('d', $out_datetime);
$vro['dateMonth_text'] = date('M', $out_datetime);
$vro['dateYear_text'] = date('Y', $out_datetime);
if ($out_datetime !== $out_datetime2) {
$vro['start_date'] = $vro['start_date'] . " to " . $vro['end_date'];
}
$poi = new stdclass();
foreach ($order_project as $kd => $poi_info) {
if (strcmp($vro['start_date'], substr($poi_info->COLD_StartDate, 0, 10) ) === 0) {
if (strcmp($vro['start_date_raw'], substr($poi_info->COLD_StartDate, 0, 10) ) === 0) {
if (count((array)$poi)===0) {
$poi = $poi_info;
} else if ($poi->POI_Hotel == "") {
@ -104,6 +112,10 @@ class Api extends CI_Controller {
$vro['cold_date'] = $poi->COLD_StartDate;
$vro['cold_enddate'] = $poi->COLD_EndDate;
$vro['tour_name'] = $poi->PAG2_Name;
$code_name = $this->trippest->tour_name(strtoupper($poi->pag_code));
if ($code_name !== "") {
$vro['tour_name'] = $code_name;
}
// 领队名字
$vro['leader_name'] = trim($poi->GUT_FirstName . " " . $poi->GUT_LastName);
// 行程人数
@ -155,8 +167,8 @@ class Api extends CI_Controller {
$ret['operation'] = array_values($ret['operation']);
$ret_operation = array();
foreach ($ret['operation'] as $ko => $vo) {
if (strtotime($vo['start_date']) >= strtotime($vo['cold_date'])
&& strtotime($vo['start_date']) <= strtotime($vo['cold_enddate'])) {
if (strtotime($vo['start_date_raw']) >= strtotime($vo['cold_date'])
&& strtotime($vo['start_date_raw']) <= strtotime($vo['cold_enddate'])) {
unset($vo['cold_date']);
unset($vo['cold_enddate']);
$ret_operation[] = $vo;

@ -0,0 +1,38 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Trippest
{
protected $ci;
public function __construct()
{
$this->ci =& get_instance();
}
public function tour_name($pag_code)
{
$name = "";
switch ($pag_code) {
case 'BJSIC-41':
$name = "One Day Beijing Highlights Tour";
break;
case 'BJSIC-42':
$name = "Two-Day Beijing Boutique Small Group Tour";
break;
case 'BJSIC-43':
$name = "Three-Day Beijing Discovery Tour";
break;
default:
# code...
break;
}
return $name;
}
}
/* End of file trippest.php */
/* Location: ./third_party/trippestOrderSync/libraries/trippest.php */

@ -28,6 +28,7 @@ class Orders_query extends CI_Model {
{
$order_info_sql = "SELECT
GCI_SN,GCI_VendorOrderId,GCI_combineNo
,(select PAG_code from biz_packageinfo where pag_sn=COLD_ServiceSN) as pag_code
,COLI_SN,COLI_ID,COLD_SN,COLI_GroupCode,COLI_OPI_ID,COLI_OrderDetailText,COLI_PriceMemo
,COLD_ServiceSN,COLD_PersonNum,COLD_ChildNum,COLD_StartDate,COLD_EndDate,cold.COLD_MemoText
,pags.PAGS_Direction,pags.PAGS_describ

Loading…
Cancel
Save