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.
 
 
 
 

77 lines
2.5 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: gaoh
  5. * Date: 2016/11/3
  6. * Time: 14:31
  7. */
  8. require_once __DIR__ . '/../HotelLib.php';
  9. class UpdateHotelModel extends HotelLib
  10. {
  11. //根据酒店ID得到基础房型的ID串和area_id
  12. public function getBase($id)
  13. {
  14. $sql = "select room_type_all , area_id,star_level from opera_hotel WHERE hotel_id='$id'";
  15. writeLog(__FUNCTION__ . " sql= " . $sql);
  16. $res = $this->DBTool->queryBySql($sql);
  17. return $res;
  18. }
  19. //查询基础房型名称
  20. public function getroom($res_id)
  21. {
  22. $sql = "select res_name from base_resource WHERE res_id='$res_id'";
  23. writeLog(__FUNCTION__ . " sql= " . $sql);
  24. $res = $this->DBTool->queryBySql($sql);
  25. return $res;
  26. }
  27. //查询parent_id
  28. // public function getparentid($area_id)
  29. // {
  30. // $sql = "select parent_id from base_area WHERE id='$area_id'";
  31. // writeLog(__FUNCTION__ . " sql= " . $sql);
  32. // $res = $this->DBTool->queryBySql($sql);
  33. // return $res;
  34. // }
  35. //查询parent_id
  36. public function getssqid($area_id)
  37. {
  38. $sql = "select top_area_id,parent_area_id from base_area_view WHERE area_id='$area_id'";
  39. writeLog(__FUNCTION__ . " sql= " . $sql);
  40. $res = $this->DBTool->queryBySql($sql);
  41. return $res;
  42. }
  43. //查询省市区列表
  44. public function getlist($parent_area_id)
  45. {
  46. $sql = "select area_id,area_name from base_area_view WHERE parent_area_id='$parent_area_id' AND area_id<3223";
  47. writeLog(__FUNCTION__ . " sql= " . $sql);
  48. $res = $this->DBTool->queryBySql($sql);
  49. $list = $res['rowset'];
  50. return $list;
  51. }
  52. //更新酒店信息
  53. public function updateHotel($hotel_id, $address, $room_type_all, $area_id, $user_id, $star_level, $hotel_name)
  54. {
  55. $sql = "update opera_hotel set hotel_address='$address',
  56. room_type_all='$room_type_all',
  57. room_type_sale='$room_type_all',
  58. area_id='$area_id',
  59. update_user_id='$user_id',
  60. update_time=now() ,
  61. star_level='$star_level',
  62. hotel_name='$hotel_name'
  63. WHERE
  64. hotel_id='$hotel_id'";
  65. writeLog(__FUNCTION__ . " sql= " . $sql);
  66. $res = $this->DBTool->execSql($sql);
  67. return $res;
  68. }
  69. }