|
|
|
|
@ -209,14 +209,16 @@ class OrderFinance_model extends CI_Model {
|
|
|
|
|
/** 判断各种项目的报表是否已存在 */
|
|
|
|
|
public function report_tour_exists($coli_id=null, $tourCode=null, $tourBz=null)
|
|
|
|
|
{
|
|
|
|
|
$sql = "SELECT top 10 ordernumber from report_tour where ordernumber=? and tourCode=? ";
|
|
|
|
|
$sql = "SELECT top 10 ordernumber from report_tour where ordernumber=? ";
|
|
|
|
|
if ($tourBz) {
|
|
|
|
|
$tourBz = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]', '', strstr($tourBz, ",", true));
|
|
|
|
|
$tourBz = str_replace("[", "[[]", $tourBz);
|
|
|
|
|
$sql .= " and (tourBz like '%" . $this->HT->escape_like_str($tourBz) . "%'
|
|
|
|
|
OR tourBz='') ";
|
|
|
|
|
} else {
|
|
|
|
|
$sql .= " AND tourCode='" . $tourCode . "' ";
|
|
|
|
|
}
|
|
|
|
|
$num_rows = $this->HT->query($sql, array($coli_id, $tourCode))->num_rows();
|
|
|
|
|
$num_rows = $this->HT->query($sql, array($coli_id))->num_rows();
|
|
|
|
|
return $num_rows>0;
|
|
|
|
|
}
|
|
|
|
|
public function report_train_exists($coli_id=null, $TrainNo=null)
|
|
|
|
|
@ -244,7 +246,7 @@ class OrderFinance_model extends CI_Model {
|
|
|
|
|
foreach ($report_tour_arr as $krt => $vrt) {
|
|
|
|
|
$tourBz_tmp = "";
|
|
|
|
|
if ($this->report_tour_exists($vrt['ordernumber'], $vrt['tourCode'], $vrt['tourBZ']) === TRUE) {
|
|
|
|
|
$where = " ordernumber='" . $vrt['ordernumber'] . "' AND tourCode='" . $vrt['tourCode'] . "' ";
|
|
|
|
|
$where = " ordernumber='" . $vrt['ordernumber'] . "' "; //AND tourCode='" . $vrt['tourCode'] . "' ";
|
|
|
|
|
$tourBz_tmp = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]', '', strstr($vrt['tourBZ'], ",", true));
|
|
|
|
|
$tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp);
|
|
|
|
|
$where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%'
|
|
|
|
|
|