login_user_id; $hotel_id=isset($_POST['hotel_id'])?$_POST['hotel_id']:(isset($_GET['hotel_id'])?$_GET['hotel_id']:""); // 不为空 $parent_room_type=isset($_POST['parent_room_type'])?$_POST['parent_room_type']:(isset($_GET['parent_room_type'])?$_GET['parent_room_type']:""); // 不为空 $start_date=isset($_POST['start_date'])?$_POST['start_date']:(isset($_GET['start_date'])?$_GET['start_date']:""); // 不为空 $end_date=isset($_POST['end_date'])?$_POST['end_date']:(isset($_GET['end_date'])?$_GET['end_date']:""); // 不为空 $week_day=isset($_POST['week_day'])?$_POST['week_day']:(isset($_GET['week_day'])?$_GET['week_day']:""); // 不为空 $price_buyout=isset($_POST['price_buyout'])?$_POST['price_buyout']:(isset($_GET['price_buyout'])?$_GET['price_buyout']:""); // 不为空 $price_reserve=isset($_POST['price_reserve'])?$_POST['price_reserve']:(isset($_GET['price_reserve'])?$_GET['price_reserve']:""); // 不为空 $price_inquiry=isset($_POST['price_inquiry'])?$_POST['price_inquiry']:(isset($_GET['price_inquiry'])?$_GET['price_inquiry']:""); // 不为空 $person_limit=isset($_POST['person_limit'])?$_POST['person_limit']:(isset($_GET['person_limit'])?$_GET['person_limit']:""); // 不为空 $breakfast=isset($_POST['breakfast'])?$_POST['breakfast']:(isset($_GET['breakfast'])?$_GET['breakfast']:""); // 不为空 $room_name=isset($_POST['room_name'])?$_POST['room_name']:(isset($_GET['room_name'])?$_GET['room_name']:""); // 不为空 if(empty($hotel_id) || empty($start_date) || empty($end_date) || empty($week_day) || ($price_buyout==''&&$price_reserve==''&&$price_inquiry=='') || (empty($person_limit) || $person_limit<=0) || empty($breakfast) || empty($room_name)){ $data['code']="16"; $data['info']="错误的请求参数"; return $data; } $roomModel=array(); $roomModel['user_id']=$user_id; $roomModel['hotel_id']=$hotel_id; $roomModel['parent_room_type']=$parent_room_type; $roomModel['start_date']=$start_date; $roomModel['end_date']=$end_date; $roomModel['week_day']=$week_day; $roomModel['run_status']=1; $roomModel['price_buyout']=$price_buyout; $roomModel['price_reserve']=$price_reserve; $roomModel['price_inquiry']=$price_inquiry; $roomModel['person_limit']=$person_limit; $roomModel['breakfast']=$breakfast; $roomModel['room_name']=$room_name; $addChildRoom = new HTChildRoom; $data=$addChildRoom->addChildRoom($roomModel); return $data; } } $addChildRoom = new addChildRoom; $data=$addChildRoom->addChildrenRm(); echo json_encode($data);