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.
 
 
 
 

39 lines
1.5 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: gaoh
  5. * Date: 2016/11/1
  6. * Time: 11:45
  7. */
  8. require_once __DIR__ . '/../HotelLib.php';
  9. class AddhotelModel extends HotelLib
  10. {
  11. //根据基本房型名称查询res_id
  12. public function getId($name)
  13. {
  14. $sql = "select res_id from base_resource WHERE res_type_id=26 AND res_name='$name' AND cancel_flag=0";
  15. writeLog(__FUNCTION__ . " sql= " . $sql);
  16. $res = $this->DBTool->queryBySql($sql);
  17. return $res;
  18. }
  19. //新增基本房型
  20. public function AddBaseroom($name,$user_id,$area_id)
  21. {
  22. $sql="insert into base_resource (res_id,res_name,res_type_id,create_user_id,create_time,area_id)
  23. VALUES ((select max(b.res_id)+1 from base_resource as b),'$name','26','$user_id',NOW(),'$area_id')";
  24. writeLog(__FUNCTION__ . " sql= " . $sql);
  25. $res = $this->DBTool->execSql($sql);
  26. return $res;
  27. }
  28. //新增酒店
  29. public function AddHotel($name, $area_id, $address, $room_type,$purchase_name,$user_id,$star_level)
  30. {
  31. $sql="insert into opera_hotel (hotel_name,area_id,hotel_address,room_type_all,room_type_sale,purchase_name,create_time,create_user_id,update_time,update_user_id,star_level)
  32. VALUES ('$name','$area_id','$address','$room_type','$room_type','$purchase_name',NOW(),'$user_id',NOW(),'$user_id','$star_level')";
  33. writeLog(__FUNCTION__ . " sql= " . $sql);
  34. $res = $this->DBTool->execSql($sql);
  35. return $res;
  36. }
  37. }