You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

66 lines
2.4 KiB

  1. <?php
  2. //Author:fuhc
  3. //Date:20160924
  4. //修改子房型
  5. require_once "Api/ApiBase.php";
  6. require_once "Lib/Action/HTChildRoom.class.php";
  7. class UpdateChildRoom extends ApiBase
  8. {
  9. function __construct()
  10. {
  11. parent::__construct();
  12. }
  13. // 修改基础房型
  14. function updateChildRm()
  15. {
  16. $user_id = $this->login_user_id;
  17. $run_status = isset($_POST['run_status']) ? $_POST['run_status'] : (isset($_GET['run_status']) ? $_GET['run_status'] : ""); // 不为空
  18. $run_date = isset($_POST['run_date']) ? $_POST['run_date'] : (isset($_GET['run_date']) ? $_GET['run_date'] : ""); // 不为空
  19. $room_type = isset($_POST['room_type']) ? $_POST['room_type'] : (isset($_GET['room_type']) ? $_GET['room_type'] : ""); // 不为空
  20. $hotel_id = isset($_POST['hotel_id']) ? $_POST['hotel_id'] : (isset($_GET['hotel_id']) ? $_GET['hotel_id'] : ""); // 不为空
  21. $price_buyout = isset($_POST['price_buyout']) ? $_POST['price_buyout'] : (isset($_GET['price_buyout']) ? $_GET['price_buyout'] : ""); // 不为空
  22. $price_reserve = isset($_POST['price_reserve']) ? $_POST['price_reserve'] : (isset($_GET['price_reserve']) ? $_GET['price_reserve'] : ""); // 不为空
  23. $price_inquiry = isset($_POST['price_inquiry']) ? $_POST['price_inquiry'] : (isset($_GET['price_inquiry']) ? $_GET['price_inquiry'] : ""); // 不为空
  24. if (empty($run_status) || empty($run_date) || empty($room_type) || empty($hotel_id)
  25. ) {
  26. $data['code'] = "16";
  27. $data['info'] = "错误的请求参数";
  28. return $data;
  29. }
  30. if (trim($price_buyout) === '' && trim($price_reserve) === '' && trim($price_inquiry) === '') {
  31. $data['code'] = "17";
  32. $data['info'] = "买断,保留,现询,不能同时为空";
  33. return $data;
  34. }
  35. $Child = array(
  36. "user_id" => $user_id,
  37. "run_status" => $run_status,
  38. "run_date" => $run_date,
  39. "room_type" => $room_type,
  40. "hotel_id" => $hotel_id,
  41. 'price_buyout' => $price_buyout,
  42. 'price_reserve' => $price_reserve,
  43. 'price_inquiry' => $price_inquiry,
  44. );
  45. $childRoom = new HTChildRoom;
  46. $data = $childRoom->updateChildRoom($Child);
  47. return $data;
  48. }
  49. }
  50. $obj = new UpdateChildRoom();
  51. $data = $obj->updateChildRm();
  52. echo json_encode($data);