|
123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
-
- /**
- * Created by PhpStorm.
- * User: gaoh
- * Date: 2016/11/1
- * Time: 11:45
- */
- require_once __DIR__ . '/../HotelLib.php';
-
- class AddhotelModel extends HotelLib
- {
- //根据基本房型名称查询res_id
- public function getId($name)
- {
- $sql = "select res_id from base_resource WHERE res_type_id=26 AND res_name='$name' AND cancel_flag=0";
- writeLog(__FUNCTION__ . " sql= " . $sql);
- $res = $this->DBTool->queryBySql($sql);
- return $res;
- }
- //新增基本房型
- public function AddBaseroom($name,$user_id,$area_id)
- {
- $sql="insert into base_resource (res_id,res_name,res_type_id,create_user_id,create_time,area_id)
- VALUES ((select max(b.res_id)+1 from base_resource as b),'$name','26','$user_id',NOW(),'$area_id')";
- writeLog(__FUNCTION__ . " sql= " . $sql);
- $res = $this->DBTool->execSql($sql);
- return $res;
- }
- //新增酒店
- public function AddHotel($name, $area_id, $address, $room_type,$purchase_name,$user_id,$star_level)
- {
- $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)
- VALUES ('$name','$area_id','$address','$room_type','$room_type','$purchase_name',NOW(),'$user_id',NOW(),'$user_id','$star_level')";
- writeLog(__FUNCTION__ . " sql= " . $sql);
- $res = $this->DBTool->execSql($sql);
- return $res;
- }
- }
|