getUserId(); $room_type_sale=isset($_POST['room_type_sale'])?$_POST['room_type_sale']:(isset($_GET['room_type_sale'])?$_GET['room_type_sale']:""); // 可为空 $hotel_id=isset($_POST['hotel_id'])?$_POST['hotel_id']:(isset($_GET['hotel_id'])?$_GET['hotel_id']:""); // 不为空 if($hotel_id==""){ $data['code']="16"; $data['info']="错误的请求参数"; return $data; } $baseRoom=new HTBaseRoom; $data=$baseRoom->addBaseRoom('1',$room_type_sale,$hotel_id); return $data; } } $addBaseRoom=new AddBaseRoom; $data=$addBaseRoom->addBaseRoom(); echo json_encode($data);