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