diff --git a/webht/third_party/trippestOrderSync/controllers/api.php b/webht/third_party/trippestOrderSync/controllers/api.php index bd3f12b1..30abde5e 100644 --- a/webht/third_party/trippestOrderSync/controllers/api.php +++ b/webht/third_party/trippestOrderSync/controllers/api.php @@ -24,10 +24,13 @@ class Api extends CI_Controller { public function operation_detail($find=null) { ($find===null) ? $find = $this->input->get_post('q') : null; - $find = (mb_strlen($find)<9) ? null : $this->input->get_post('q'); + $find = (mb_strlen($find)<9) ? null : $find; preg_match('/[\d]+\-?[\w]*/', characet($find, "UTF-8"), $temp_array); - $find = $temp_array[0]; - $order_plan = $this->Orders_model->get_order_vendorplan($find); + $find = isset($temp_array[0]) ? $temp_array[0] : null; + $order_plan = null; + if ($find !== null) { + $order_plan = $this->Orders_model->get_order_vendorplan($find); + } if ($find===null || $order_plan == null) { $ret['status'] = 0; $ret['msg'] = "Not Found."; diff --git a/webht/third_party/trippestOrderSync/models/orderFinance_model.php b/webht/third_party/trippestOrderSync/models/orderFinance_model.php index 6f6c0ffc..fd3ebe2d 100644 --- a/webht/third_party/trippestOrderSync/models/orderFinance_model.php +++ b/webht/third_party/trippestOrderSync/models/orderFinance_model.php @@ -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) . "%'