From a6d46ed096d1979ac0d8ac57869423a45a098bc5 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 9 Jul 2019 09:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E7=A5=A8=E6=90=9C=E7=B4=A2=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tuniu/controllers/tuniu_flight.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 application/third_party/tuniu/controllers/tuniu_flight.php diff --git a/application/third_party/tuniu/controllers/tuniu_flight.php b/application/third_party/tuniu/controllers/tuniu_flight.php new file mode 100644 index 00000000..ec494c73 --- /dev/null +++ b/application/third_party/tuniu/controllers/tuniu_flight.php @@ -0,0 +1,45 @@ +load->helper('tuniu'); + } + + public function index(){ + echo 'tuniu flight'; + } + + public function data_show(){ + $timestamp = time(); + $function = 'queryNew'; + $data = '{"channelId":7,"departureDate":"2019-07-10","dstCityCode":"PVG","orgCityCode":"PEK","vendorId":[4333]}'; + $sign = md5(TUNIU_FLIGHT_KEY.$data.$timestamp); + + $postJson = '{ + "purchaseId": '.TUNIU_FLIGHT_ID.', + "sign": "'.$sign .'", + "timestamp": '.$timestamp.', + "function": "'.$function.'", + "data":'.$data.' + }'; + + $returnJson = post_tuniu(TUNIU_FLIGHT_API,$postJson,'POST'); + + $returnData = json_decode($returnJson); + //print_r($returnData); + echo $returnJson; + } +} \ No newline at end of file