|
- <?php
- //Author:fuhc
- //Date:20160924
- //修改子房型
-
-
- require_once "Api/ApiBase.php";
- require_once "Lib/Action/HTChildRoom.class.php";
-
- class UpdateChildRoom extends ApiBase
- {
-
- function __construct()
- {
- parent::__construct();
-
- }
-
- // 修改基础房型
- function updateChildRm()
- {
- $user_id = $this->login_user_id;
- $run_status = isset($_POST['run_status']) ? $_POST['run_status'] : (isset($_GET['run_status']) ? $_GET['run_status'] : ""); // 不为空
- $run_date = isset($_POST['run_date']) ? $_POST['run_date'] : (isset($_GET['run_date']) ? $_GET['run_date'] : ""); // 不为空
- $room_type = isset($_POST['room_type']) ? $_POST['room_type'] : (isset($_GET['room_type']) ? $_GET['room_type'] : ""); // 不为空
- $hotel_id = isset($_POST['hotel_id']) ? $_POST['hotel_id'] : (isset($_GET['hotel_id']) ? $_GET['hotel_id'] : ""); // 不为空
- $price_buyout = isset($_POST['price_buyout']) ? $_POST['price_buyout'] : (isset($_GET['price_buyout']) ? $_GET['price_buyout'] : ""); // 不为空
- $price_reserve = isset($_POST['price_reserve']) ? $_POST['price_reserve'] : (isset($_GET['price_reserve']) ? $_GET['price_reserve'] : ""); // 不为空
- $price_inquiry = isset($_POST['price_inquiry']) ? $_POST['price_inquiry'] : (isset($_GET['price_inquiry']) ? $_GET['price_inquiry'] : ""); // 不为空
-
- if (empty($run_status) || empty($run_date) || empty($room_type) || empty($hotel_id)
- ) {
- $data['code'] = "16";
- $data['info'] = "错误的请求参数";
- return $data;
- }
- if (trim($price_buyout) === '' && trim($price_reserve) === '' && trim($price_inquiry) === '') {
- $data['code'] = "17";
- $data['info'] = "买断,保留,现询,不能同时为空";
- return $data;
- }
-
- $Child = array(
- "user_id" => $user_id,
- "run_status" => $run_status,
- "run_date" => $run_date,
- "room_type" => $room_type,
- "hotel_id" => $hotel_id,
-
- 'price_buyout' => $price_buyout,
- 'price_reserve' => $price_reserve,
- 'price_inquiry' => $price_inquiry,
- );
- $childRoom = new HTChildRoom;
- $data = $childRoom->updateChildRoom($Child);
- return $data;
- }
- }
-
- $obj = new UpdateChildRoom();
- $data = $obj->updateChildRm();
- echo json_encode($data);
-
-
|