diff --git a/webht/third_party/trippestOrderSync/controllers/order_finance.php b/webht/third_party/trippestOrderSync/controllers/order_finance.php index fbd7aab6..e5d07047 100644 --- a/webht/third_party/trippestOrderSync/controllers/order_finance.php +++ b/webht/third_party/trippestOrderSync/controllers/order_finance.php @@ -72,9 +72,9 @@ class Order_finance extends CI_Controller { $report_order['childnumber'] = 0; $report_order['babynumber'] = 0; $report_order['ordernumber'] = $order_info->ordernumber; - $report_order['TuanName'] = $order_info->TuanName; + $report_order['TuanName'] = mb_substr($order_info->TuanName, 0, 50); $report_order['operater'] = $order_info->operater; - $report_order['Agenter'] = $order_info->Agenter; + $report_order['Agenter'] = mb_substr($order_info->Agenter,0,10); $report_order['ChinaName'] = $order_info->ChinaName; $report_order['country'] = $order_info->country; $report_order['reservedate'] = $order_info->reservedate; @@ -118,13 +118,12 @@ class Order_finance extends CI_Controller { } } /** 保存图兰朵包价线路产品的成本到report_tour */ - // TODO // pvt $report_tour_pvt = array(); if ( ! empty($ret->pvt)) { $report_tour_pvt['ordernumber'] = $ret->pvt->coli_id; - $report_tour_pvt['tourCode'] = $ret->pvt->PAG_Code; - $report_tour_pvt['tourname'] = $ret->pvt->pag_name; + $report_tour_pvt['tourCode'] = mb_substr($ret->pvt->PAG_Code, 0, 50); + $report_tour_pvt['tourname'] = mb_substr($ret->pvt->pag_name, 0, 200); $report_tour_pvt['tourtime'] = $ret->pvt->startdate; $report_tour_pvt['tourRSd'] = $ret->pvt->adult_num; $report_tour_pvt['tourRSx'] = $ret->pvt->child_num; @@ -133,8 +132,8 @@ class Order_finance extends CI_Controller { $report_tour_pvt['tourcost'] = $ret->pvt->cost_sum; $report_tour_pvt['tourPrice'] = $this->OrderFinance_model->convert_to_RMB($ret->pvt->totalPrice); $report_tour_pvt['tourProfit'] = ($report_tour_pvt['tourPrice']>0) ? bcsub($report_tour_pvt['tourPrice'], $report_tour_pvt['tourcost']) : 0; - $report_tour_pvt['tourProvide'] = $ret->pvt->vendor_name; - $report_tour_pvt['tourBZ'] = $ret->pvt->comment; + $report_tour_pvt['tourProvide'] = mb_substr($ret->pvt->vendor_name, 0, 50); + $report_tour_pvt['tourBZ'] = mb_substr($ret->pvt->comment, 0, 150); $report_tour_pvt['orderstats'] = 0; // 成本详情 $report_tour_pvt['RPT_Car'] = $ret->pvt->cost_category['touristCarOperations']; @@ -155,8 +154,8 @@ class Order_finance extends CI_Controller { foreach ($ret->combine_cost as $kcc => $cost) { $cost_c = array(); $cost_c['ordernumber'] = $cost->coli_id; - $cost_c['tourCode'] = implode(',', array_unique(array_map(function($ele){ return $ele->real_code; }, $cost->order_cost))); - $cost_c['tourname'] = $cost->pag_name; + $cost_c['tourCode'] = mb_substr(implode(',', array_unique(array_map(function($ele){ return $ele->real_code; }, $cost->order_cost))), 0, 50); + $cost_c['tourname'] = mb_substr($cost->pag_name, 0, 200) ; $cost_c['tourtime'] = $cost->startdate; $cost_c['tourRSd'] = $cost->order_cost[0]->adult_num; $cost_c['tourRSx'] = $cost->order_cost[0]->child_num; @@ -171,8 +170,8 @@ class Order_finance extends CI_Controller { } $cost_c['tourPrice'] = $this->OrderFinance_model->convert_to_RMB($cost_c_price); $cost_c['tourProfit'] = ($cost_c['tourPrice']>0) ? bcsub($cost_c['tourPrice'], $cost_c['tourcost']) : 0; - $cost_c['tourProvide'] = $cost->vendor_name; - $cost_c['tourBZ'] = $cost->comment; + $cost_c['tourProvide'] = mb_substr($cost->vendor_name, 0, 50); + $cost_c['tourBZ'] = mb_substr($cost->comment, 0, 150); $cost_c['orderstats'] = 0; // 成本详情 $cost_c['RPT_Car'] = $cost->cost_category['touristCarOperations']; @@ -343,8 +342,8 @@ class Order_finance extends CI_Controller { } $this_order_real_pag_sns = array_map(function($ele) {return $ele->real_pag_sn;}, $ret->order_cost); $pags_info = $this->OrderFinance_model->get_pag_info(implode(',', array_unique(array_filter($this_order_real_pag_sns)))); // $pag_sns - $ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; // 50 - $ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; // TODO 限制200 用mb_substr('UTF-8') + $ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; + $ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; $ret->PAG_Code = implode(",", $ret->combine_pags); $ret->comment = "拼团" . $combineNo . ", 按" . $ret->person_num . "人等"; $combine_cost = $this->OrderFinance_model->get_combine_sumMoney($combineNo); @@ -394,9 +393,9 @@ class Order_finance extends CI_Controller { $ret->comment = "PVT,共" . $ret->person_num . "人次";// 150 $pag_sns = array_values(array_unique(array_map(function($ele) {return $ele->COLD_ServiceSN;}, $all_orders))); $pags_info = $this->OrderFinance_model->get_pag_info(implode(',', $pag_sns)); - $ret->PAG_Code = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->PAG_Code;}, $pags_info)))); // TODO 限制50 - $ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; // 50 - $ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; // TODO 限制200 用mb_substr('UTF-8') + $ret->PAG_Code = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->PAG_Code;}, $pags_info)))); + $ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; + $ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; // $ret->tour[0] = $tour_s; // $ret->order_cost = array_sum(array_map(function($ele) {return $ele->cost_sum;}, $ret->tour)); return $ret; diff --git a/webht/third_party/trippestOrderSync/models/orderFinance_model.php b/webht/third_party/trippestOrderSync/models/orderFinance_model.php index ed6672b9..f95fcb82 100644 --- a/webht/third_party/trippestOrderSync/models/orderFinance_model.php +++ b/webht/third_party/trippestOrderSync/models/orderFinance_model.php @@ -245,7 +245,7 @@ $this->HT2 = $this->load->database('INFO', TRUE); // test adultcost adultPrice, COLD_TotalCost as TotalCost, COLD_TotalPrice*6.77 as TotalPrice, --test - VEI2_CompanyBN TrainProvide, + SUBSTRING(VEI2_CompanyBN,1,50) TrainProvide, ' ' as TrainBZ, -- test -- case when dbo.GetBIZTrainVEIDebt(COLD_SN)='YES' then '挂账' else ' ' end as TrainBZ, 0 as orderstats @@ -279,13 +279,13 @@ $this->HT2 = $this->load->database('INFO', TRUE); // test { $sql = " SELECT coli_id ordernumber, - v2.VEI2_CompanyBN AS hotelName, + SUBSTRING(v2.VEI2_CompanyBN,1,50) AS hotelName, cityinfo2.CII2_Name AS cityName, (SELECT SGC_ServiceGrade FROM servicegradecode2 WHERE SGC2_LGC=2 AND SGC2_SGC_SN=Isnull(VEI_Grade,-1)) AS hotelStar, - (SELECT ROT2_TypeName + (SELECT SUBSTRING(ROT2_TypeName,1,100) as ROT2_TypeName FROM roomtype2 WHERE ROT2_ROT_SN=ISNULL(COLD_ServiceSN2,-1) AND ROT2_LGC=1) AS roomtype, @@ -301,8 +301,8 @@ $this->HT2 = $this->load->database('INFO', TRUE); // test COLD_TotalCost roomcost, COLD_TotalPrice*6.77 as roomprice, (COLD_TotalPrice/1.03*6.77)-COLD_TotalCost as roomprofit, - VendorInfo2.VEI2_CompanyBN AS roomprovide, - COLD_Describe roombz, + SUBSTRING(VendorInfo2.VEI2_CompanyBN,1,50) AS roomprovide, + SUBSTRING(COLD_Describe,1,150) roombz, 0 as orderstats FROM BIZ_ConfirmLineDetail INNER JOIN BIZ_ConfirmLineInfo ON COLD_COLI_SN=COLI_SN @@ -339,7 +339,7 @@ $this->HT2 = $this->load->database('INFO', TRUE); // test $sql = "SELECT dbo.BIZ_ConfirmLineInfo.COLI_ID ordernumber, dbo.BIZ_PackageInfo.PAG_Code tourCode, - dbo.BIZ_PackageInfo.PAG_Title tourname, + SUBSTRING(dbo.BIZ_PackageInfo.PAG_Title,1,200) tourname, SUBSTRING(CONVERT(varchar,dbo.BIZ_ConfirmLineDetail.COLD_StartDate, 120), 1, 10) AS tourtime, dbo.BIZ_ConfirmLineDetail.COLD_PersonNum tourRSd, dbo.BIZ_ConfirmLineDetail.COLD_ChildNum tourRSx, @@ -370,7 +370,7 @@ $this->HT2 = $this->load->database('INFO', TRUE); // test -- dbo.ConvertToRMB('USD',dbo.BIZ_ConfirmLineDetail.COLD_TotalPrice)-dbo.BIZ_ConfirmLineDetail.COLD_TotalCost as tourProfit, dbo.BIZ_ConfirmLineDetail.COLD_TotalPrice*6.77 tourPrice, (dbo.BIZ_ConfirmLineDetail.COLD_TotalPrice*6.77)-dbo.BIZ_ConfirmLineDetail.COLD_TotalCost as tourProfit, - isnull(dbo.VEndorInfo2.VEI2_CompanyBN,'.') as tourProvide, + SUBSTRING(isnull(dbo.VEndorInfo2.VEI2_CompanyBN,'.'),1,50) as tourProvide, SUBSTRING(dbo.BIZ_ConfirmLineDetail.COLD_Describe,1,70) as tourBZ, 0 as orderstats FROM dbo.BIZ_ConfirmLineDetail