From 63d3c4f86f5b109486d93016a3f56e04dc2395e4 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 30 Oct 2018 17:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E8=A1=A8:=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9B=B8=E5=90=8C=E6=8B=BC=E5=9B=A2=E5=8F=B7=E7=9A=84?= =?UTF-8?q?report=5Ftour;=20Tracking:=E8=A7=A3=E5=86=B3warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/trippestOrderSync/controllers/api.php | 9 ++++++--- .../trippestOrderSync/models/orderFinance_model.php | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) 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) . "%'