Merge branch 'feature/trippest'

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

@ -227,20 +227,21 @@ class OrderFinance_model extends CI_Model {
} }
/** 判断各种项目的报表是否已存在 */ /** 判断各种项目的报表是否已存在 */
public function report_tour_exists($coli_id=null, $tourCode=null, $tourBz=null) public function report_tour_exists($coli_id=null, $cold_sn=null)
{ {
$sql = "SELECT top 10 ordernumber from report_tour where ordernumber=? "; $sql = "SELECT top 10 ordernumber from report_tour where ordernumber=? ";
if ($tourBz) { $sql .= $cold_sn===null ? " " : " and RPT_COLD_SN=$cold_sn ";
$tourBz = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($tourBz, ",", true)); // if ($tourBz) {
if (stripos($tourBz, "pvt") === false) { // $tourBz = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($tourBz, ",", true));
$tourBz = str_replace("]", "", $tourBz); // if (stripos($tourBz, "pvt") === false) {
} // $tourBz = str_replace("]", "", $tourBz);
$tourBz = str_replace("[", "[[]", $tourBz); // }
$sql .= " and (tourBz like '%" . $this->HT->escape_like_str($tourBz) . "%' // $tourBz = str_replace("[", "[[]", $tourBz);
OR tourBz='') "; // $sql .= " and (tourBz like '%" . $this->HT->escape_like_str($tourBz) . "%'
} else { // OR tourBz='') ";
$sql .= " AND tourCode='" . $tourCode . "' "; // } else {
} // $sql .= " AND tourCode='" . $tourCode . "' ";
// }
$num_rows = $this->HT->query($sql, array($coli_id))->num_rows(); $num_rows = $this->HT->query($sql, array($coli_id))->num_rows();
return $num_rows>0; return $num_rows>0;
} }
@ -268,15 +269,15 @@ class OrderFinance_model extends CI_Model {
{ {
foreach ($report_tour_arr as $krt => $vrt) { foreach ($report_tour_arr as $krt => $vrt) {
$tourBz_tmp = ""; $tourBz_tmp = "";
if ($this->report_tour_exists($vrt['ordernumber'], $vrt['tourCode'], $vrt['tourBZ']) === TRUE) { if ($this->report_tour_exists($vrt['ordernumber'], $vrt['RPT_COLD_SN']) === TRUE) {
$where = " ordernumber='" . $vrt['ordernumber'] . "' "; //AND tourCode='" . $vrt['tourCode'] . "' "; $where = " ordernumber='" . $vrt['ordernumber'] . "' and RPT_COLD_SN=".$vrt['RPT_COLD_SN'] ; //AND tourCode='" . $vrt['tourCode'] . "' ";
$tourBz_tmp = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($vrt['tourBZ'], ",", true)); // $tourBz_tmp = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($vrt['tourBZ'], ",", true));
if (stripos($tourBz_tmp, "pvt") === false) { // if (stripos($tourBz_tmp, "pvt") === false) {
$tourBz_tmp = str_replace("]", "", $tourBz_tmp); // $tourBz_tmp = str_replace("]", "", $tourBz_tmp);
} // }
$tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp); // $tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp);
$where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%' // $where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%'
OR tourBZ='') "; // OR tourBZ='') ";
$delete_sql = "DELETE FROM tourmanager.dbo.Report_Tour where " . $where; $delete_sql = "DELETE FROM tourmanager.dbo.Report_Tour where " . $where;
// $update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', $vrt, $where); // $update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', $vrt, $where);
$this->HT->query($delete_sql); $this->HT->query($delete_sql);
@ -388,9 +389,9 @@ class OrderFinance_model extends CI_Model {
{ {
$other_tour_cost = $this->get_report_tour_others_cost($coli_sn); $other_tour_cost = $this->get_report_tour_others_cost($coli_sn);
foreach ($other_tour_cost as $kotc => $votc) { foreach ($other_tour_cost as $kotc => $votc) {
if ($this->report_tour_exists($votc->ordernumber, $votc->tourCode, $votc->tourBZ) === TRUE) { if ($this->report_tour_exists($votc->ordernumber, $votc->RPT_COLD_SN) === TRUE) {
$where = " ordernumber='" . $votc->ordernumber . "' AND tourCode='" . $votc->tourCode . "'"; $where = " ordernumber='" . $votc->ordernumber . "' AND RPT_COLD_SN=" . $votc->RPT_COLD_SN;
$where .= " AND tourBZ='" . $votc->tourBZ . "' "; // $where .= " AND tourBZ='" . $votc->tourBZ . "' ";
$update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', json_decode(json_encode($votc), TRUE), $where); $update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', json_decode(json_encode($votc), TRUE), $where);
$this->HT->query($update_sql); $this->HT->query($update_sql);
} else { } else {
@ -432,6 +433,7 @@ class OrderFinance_model extends CI_Model {
ORDER BY PKP_PriceGrade ORDER BY PKP_PriceGrade
) as tourCostRSx, ) as tourCostRSx,
dbo.BIZ_ConfirmLineDetail.COLD_TotalCost tourcost, dbo.BIZ_ConfirmLineDetail.COLD_TotalCost tourcost,
dbo.BIZ_ConfirmLineDetail.COLD_SN RPT_COLD_SN,
dbo.ConvertToRMB('USD',dbo.BIZ_ConfirmLineDetail.COLD_TotalPrice) tourPrice, dbo.ConvertToRMB('USD',dbo.BIZ_ConfirmLineDetail.COLD_TotalPrice) tourPrice,
dbo.ConvertToRMB('USD',dbo.BIZ_ConfirmLineDetail.COLD_TotalPrice)-dbo.BIZ_ConfirmLineDetail.COLD_TotalCost as tourProfit, dbo.ConvertToRMB('USD',dbo.BIZ_ConfirmLineDetail.COLD_TotalPrice)-dbo.BIZ_ConfirmLineDetail.COLD_TotalCost as tourProfit,
SUBSTRING(isnull(dbo.VEndorInfo2.VEI2_CompanyBN,'.'),1,50) as tourProvide, SUBSTRING(isnull(dbo.VEndorInfo2.VEI2_CompanyBN,'.'),1,50) as tourProvide,

Loading…
Cancel
Save