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.
 
 
 
 

70 lines
2.2 KiB

  1. <?php
  2. require_once "Api/ApiBase.php";
  3. require_once "Lib/Action/HTModifyPrice.class.php";
  4. /**
  5. * Created by PhpStorm.
  6. * User: luocj
  7. * Date: 2016/10/24
  8. * Time: 11:31
  9. */
  10. class HTModifyPrice extends ApiBase
  11. {
  12. function RoomName()
  13. {
  14. $hotel_id = isset($_REQUEST['hotel_id']) ? $_REQUEST['hotel_id'] : "";
  15. $room_type = isset($_REQUEST['room_type']) ? $_REQUEST['room_type'] : "";
  16. if ($hotel_id == "") {
  17. $data['code'] = "3";
  18. $data['info'] = "缺少hotel_id参数";
  19. return $data;
  20. }
  21. if ($room_type == "") {
  22. $data['code'] = "";
  23. $data['info'] = "缺少room_type参数";
  24. return $data;
  25. }
  26. $HTModifyPrice = new HTBatchModifyPrice();
  27. $data = $HTModifyPrice->getRoomName($hotel_id, $room_type);
  28. return $data;
  29. }
  30. function UpdateBasePrice()
  31. {
  32. $user_id = $this->login_user_id;
  33. $hotel_id = isset($_REQUEST['hotel_id']) ? $_REQUEST['hotel_id'] : "";
  34. $para_flag = isset($_REQUEST['para_flag']) ? $_REQUEST['para_flag'] : "";
  35. $hotel_info = isset($_REQUEST['hotel_info']) ? $_REQUEST['hotel_info'] : "";
  36. if ($hotel_id == "") {
  37. $data['code'] = "3";
  38. $data['info'] = "缺少hotel_id参数";
  39. return $data;
  40. }
  41. if ($user_id == "") {
  42. $data['code'] = "999";
  43. $data['info'] = "缺少user_id参数";
  44. return $data;
  45. }
  46. if ($para_flag == "") {
  47. $data['code'] = "999";
  48. $data['info'] = "缺少para_flag参数";
  49. return $data;
  50. }
  51. if ($hotel_info == "") {
  52. $data['code'] = "999";
  53. $data['info'] = "缺少hotel_info参数";
  54. return $data;
  55. }
  56. $HTModifyPrice = new HTBatchModifyPrice();
  57. $data = $HTModifyPrice->HTUpdatePrice($user_id, $hotel_id,$para_flag,$hotel_info);
  58. return $data;
  59. }
  60. }
  61. $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : "";
  62. $HTModifyPrice = new HTModifyPrice();
  63. if ($op == 'getRoom') {
  64. $data = $HTModifyPrice->RoomName();
  65. } elseif ($op == 'up_base_price') {
  66. $data = $HTModifyPrice->UpdateBasePrice();
  67. }
  68. echo json_encode($data);