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.

HTModifyPrice.class.php 1.5 KiB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. require_once __DIR__ . '/../HotelLib.php';
  3. /**
  4. * Created by PhpStorm.
  5. * User: luocj
  6. * Date: 2016/10/24
  7. * Time: 11:33
  8. */
  9. class HTBatchModifyPrice extends HotelLib
  10. {
  11. function getRoomName($hotel_id, $room_type)
  12. {
  13. $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";
  14. $rowset = $this->DBTool->queryBySql($sql);
  15. $data = array();
  16. $data['code'] = $rowset['code'];
  17. $data['info'] = $rowset['info'];
  18. $data['room_list'] = $rowset['rowset'];
  19. return $data;
  20. }
  21. function HTUpdatePrice($user_id, $hotel_id, $para_flag, $hotel_info)
  22. {
  23. // 为2则修改价格,为1则修改房态
  24. if ($para_flag == 2) {
  25. $sql = "CALL ht_run_sub_room_modify_price('{$user_id}','{$hotel_id}','{$hotel_info}')";
  26. } elseif ($para_flag == 1) {
  27. $sql = "CALL ht_run_sub_room_modify_status('{$user_id}','{$hotel_id}','{$hotel_info}')";
  28. }
  29. writeLog(__FUNCTION__ . " sql= " . $sql);
  30. $data = array();
  31. $rowset = $this->DBTool->execProcedure($sql);
  32. $data['code'] = isset($rowset['rowset'][0][0]['errcode']) ? $rowset['rowset'][0][0]['errcode'] : "500";
  33. $data['info'] = isset($rowset['rowset'][0][0]['errinfo']) ? $rowset['rowset'][0][0]['errinfo'] : "无errinfo";
  34. return $data;
  35. }
  36. }
  37. //$HTBatchModifyPrice= new HTBatchModifyPrice();
  38. //$data =$HTBatchModifyPrice ->getRoomName(3,"1,2,3,4");
  39. //echo json_encode($data);