|
|
|
@ -270,19 +270,19 @@ class OrderFinance_model extends CI_Model {
|
|
|
|
|
{
|
|
|
|
|
foreach ($report_tour_arr as $krt => $vrt) {
|
|
|
|
|
$tourBz_tmp = "";
|
|
|
|
|
if ($this->report_tour_exists($vrt['ordernumber'], $vrt['RPT_COLD_SN']) === TRUE) {
|
|
|
|
|
$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));
|
|
|
|
|
if (stripos($tourBz_tmp, "pvt") === false) {
|
|
|
|
|
$tourBz_tmp = str_replace("]", "", $tourBz_tmp);
|
|
|
|
|
}
|
|
|
|
|
$tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp);
|
|
|
|
|
$where = " ordernumber='" . $vrt['ordernumber'] . "' and RPT_COLD_SN IN (" . $vrt['this_coldsn'] . ") " ;
|
|
|
|
|
$where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%'
|
|
|
|
|
OR tourBZ='') ";
|
|
|
|
|
OR tourBZ=''
|
|
|
|
|
OR orderstats=0
|
|
|
|
|
) ";
|
|
|
|
|
$delete_sql = "DELETE FROM tourmanager.dbo.Report_Tour where " . $where;
|
|
|
|
|
// $update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', $vrt, $where);
|
|
|
|
|
$this->HT->query($delete_sql);
|
|
|
|
|
}
|
|
|
|
|
unset($vrt['this_coldsn']);
|
|
|
|
|
$this->HT->insert('tourmanager.dbo.Report_Tour', $vrt);
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
|