|
- <?php
- require_once "Api/ApiBase.php";
- require_once "Lib/Action/HTModifyPrice.class.php";
-
- /**
- * Created by PhpStorm.
- * User: luocj
- * Date: 2016/10/24
- * Time: 11:31
- */
- class HTModifyPrice extends ApiBase
- {
- function RoomName()
- {
- $hotel_id = isset($_REQUEST['hotel_id']) ? $_REQUEST['hotel_id'] : "";
- $room_type = isset($_REQUEST['room_type']) ? $_REQUEST['room_type'] : "";
- if ($hotel_id == "") {
- $data['code'] = "3";
- $data['info'] = "缺少hotel_id参数";
- return $data;
- }
- if ($room_type == "") {
- $data['code'] = "";
- $data['info'] = "缺少room_type参数";
- return $data;
- }
- $HTModifyPrice = new HTBatchModifyPrice();
- $data = $HTModifyPrice->getRoomName($hotel_id, $room_type);
- return $data;
- }
-
- function UpdateBasePrice()
- {
- $user_id = $this->login_user_id;
- $hotel_id = isset($_REQUEST['hotel_id']) ? $_REQUEST['hotel_id'] : "";
- $para_flag = isset($_REQUEST['para_flag']) ? $_REQUEST['para_flag'] : "";
- $hotel_info = isset($_REQUEST['hotel_info']) ? $_REQUEST['hotel_info'] : "";
- if ($hotel_id == "") {
- $data['code'] = "3";
- $data['info'] = "缺少hotel_id参数";
- return $data;
- }
- if ($user_id == "") {
- $data['code'] = "999";
- $data['info'] = "缺少user_id参数";
- return $data;
- }
- if ($para_flag == "") {
- $data['code'] = "999";
- $data['info'] = "缺少para_flag参数";
- return $data;
- }
- if ($hotel_info == "") {
- $data['code'] = "999";
- $data['info'] = "缺少hotel_info参数";
- return $data;
- }
- $HTModifyPrice = new HTBatchModifyPrice();
- $data = $HTModifyPrice->HTUpdatePrice($user_id, $hotel_id,$para_flag,$hotel_info);
- return $data;
- }
- }
- $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : "";
- $HTModifyPrice = new HTModifyPrice();
- if ($op == 'getRoom') {
- $data = $HTModifyPrice->RoomName();
- } elseif ($op == 'up_base_price') {
- $data = $HTModifyPrice->UpdateBasePrice();
- }
- echo json_encode($data);
|