diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index c4204461..1b9e720f 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -59,13 +59,13 @@ class search extends CI_Controller{ if(isset($value->yw_price)){ if($value->yw_price > 0){ $ywPrice = $value->yw_price * 10; - $seat_type .= '"A3":"'.$ywPrice.'","3":"¥'.$value->yw_price.'",'; + $seat_type .= '"3":"'.$ywPrice.'","A3":"¥'.$value->yw_price.'",'; } } if(isset($value->yz_price)){ if($value->yz_price > 0){ $yzPrice = $value->yz_price * 10; - $seat_type .= '"A1":"'.$yzPrice.'","1":"¥'.$value->yz_price.'",'; + $seat_type .= '"1":"'.$yzPrice.'","A1":"¥'.$value->yz_price.'",'; } } if(isset($value->edz_price)){ @@ -81,7 +81,7 @@ class search extends CI_Controller{ if(isset($value->swz_price)){ if($value->swz_price > 0){ $swzPrice = $value->swz_price * 10; - $seat_type .= '"A9":"'.$swzPrice.'","9":"¥'.$value->swz_price.'",'; + $seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swz_price.'",'; } } $pricestr = $seat_type.'"train_no":'.'"'.$value->train_no.'"'; @@ -93,7 +93,7 @@ class search extends CI_Controller{ } } //print_r($pricestr); - print_r(json_encode($return_data)); + print_r($return_data); } //获取价格 @@ -109,7 +109,6 @@ class search extends CI_Controller{ }else{ print_r('没有数据返回'); } - } //余票转换 diff --git a/application/third_party/train/models/BIZ_train_model.php b/application/third_party/train/models/BIZ_train_model.php index 42a96a93..0bd387da 100644 --- a/application/third_party/train/models/BIZ_train_model.php +++ b/application/third_party/train/models/BIZ_train_model.php @@ -35,7 +35,8 @@ class BIZ_train_model extends CI_Model { ELSE BEGIN UPDATE TrainPriceList - SET TPL_Price = '$TPL_Price', + SET TPL_Train_No = '$TPL_Train_No', + TPL_Price = '$TPL_Price', TPL_Datetime = GETDATE(), TPL_Source = 'juhe' WHERE TPL_Train_Code = '$TPL_Train_Code' diff --git a/application/third_party/tuniu/controllers/tuniu_train.php b/application/third_party/tuniu/controllers/tuniu_train.php index 182b088b..1e4b55bc 100644 --- a/application/third_party/tuniu/controllers/tuniu_train.php +++ b/application/third_party/tuniu/controllers/tuniu_train.php @@ -96,13 +96,13 @@ class Tuniu_train extends CI_Controller{ if(isset($value->ywPrice)){ if(is_numeric($value->ywPrice)){ $ywPrice = $value->ywPrice * 10; - $seat_type .= '"A3":"'.$ywPrice.'","3":"¥'.$value->ywPrice.'",'; + $seat_type .= '"3":"'.$ywPrice.'","A3":"¥'.$value->ywPrice.'",'; } } if(isset($value->yzPrice)){ if(is_numeric($value->yzPrice)){ $yzPrice = $value->yzPrice * 10; - $seat_type .= '"A1":"'.$yzPrice.'","1":"¥'.$value->yzPrice.'",'; + $seat_type .= '"1":"'.$yzPrice.'","A1":"¥'.$value->yzPrice.'",'; } } if(isset($value->edzPrice)){ @@ -118,7 +118,7 @@ class Tuniu_train extends CI_Controller{ if(isset($value->swzPrice)){ if(is_numeric($value->swzPrice)){ $swzPrice = $value->swzPrice * 10; - $seat_type .= '"A9":"'.$swzPrice.'","9":"¥'.$value->swzPrice.'",'; + $seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swzPrice.'",'; } } $pricestr = $seat_type.'"train_no":'.'"'.$value->trainNo.'"'; diff --git a/application/third_party/tuniu/models/tuniuprice_model.php b/application/third_party/tuniu/models/tuniuprice_model.php index 64b57979..c738b903 100644 --- a/application/third_party/tuniu/models/tuniuprice_model.php +++ b/application/third_party/tuniu/models/tuniuprice_model.php @@ -33,7 +33,9 @@ class tuniuprice_model extends CI_Model { ELSE BEGIN UPDATE TrainPriceList - SET TPL_Price = '$TPL_Price', + SET + TPL_Train_No = '$TPL_Train_No', + TPL_Price = '$TPL_Price', TPL_Datetime = GETDATE(), TPL_Source = 'tuniu' WHERE TPL_Train_Code = '$TPL_Train_Code'