|
- <?php
- require_once __DIR__ . '/../HotelLib.php';
-
- /**
- * Created by PhpStorm.
- * User: luocj
- * Date: 2016/10/24
- * Time: 11:33
- */
- class HTBatchModifyPrice extends HotelLib
- {
- function getRoomName($hotel_id, $room_type)
- {
- $sql = "select room_type,room_name,parent_room_type from opera_hotel_room where hotel_id = $hotel_id and room_type in ({$room_type}) and cancel_flag=0";
- $rowset = $this->DBTool->queryBySql($sql);
- $data = array();
- $data['code'] = $rowset['code'];
- $data['info'] = $rowset['info'];
- $data['room_list'] = $rowset['rowset'];
- return $data;
- }
-
- function HTUpdatePrice($user_id, $hotel_id, $para_flag, $hotel_info)
- {
- // 为2则修改价格,为1则修改房态
- if ($para_flag == 2) {
- $sql = "CALL ht_run_sub_room_modify_price('{$user_id}','{$hotel_id}','{$hotel_info}')";
- } elseif ($para_flag == 1) {
- $sql = "CALL ht_run_sub_room_modify_status('{$user_id}','{$hotel_id}','{$hotel_info}')";
- }
- writeLog(__FUNCTION__ . " sql= " . $sql);
- $data = array();
- $rowset = $this->DBTool->execProcedure($sql);
- $data['code'] = isset($rowset['rowset'][0][0]['errcode']) ? $rowset['rowset'][0][0]['errcode'] : "500";
- $data['info'] = isset($rowset['rowset'][0][0]['errinfo']) ? $rowset['rowset'][0][0]['errinfo'] : "无errinfo";
- return $data;
- }
- }
- //$HTBatchModifyPrice= new HTBatchModifyPrice();
- //$data =$HTBatchModifyPrice ->getRoomName(3,"1,2,3,4");
- //echo json_encode($data);
|