import request from '@/utils/request'

// 获取订单数据 订单状态占比
export function getOrderData() {
	return request({
		url: '/mhotel/idcgetBookStatusData.action',
		method: 'get'
	})
}

// 查询各县民宿数量 民宿统计
export function getHomestayStatistics() {
	return request({
		url: '/mhotel/idcgetHotelData.action',
		method: 'get'
	})
}

// 订单量排行
export function getOrderVolumeRanking(param) {
	return request({
		url: '/mhotel/idcgetRankBookNumData.action?type=' + param,
		method: 'get'
	})
}

// 查询销售额排行
export function getQuerySalesRankings(param) {
	return request({
		url: '/mhotel/idcgetRankSalesAmountData.action?type=' + param,
		method: 'get'
	})
}

// 查询经营概况
export function getManagementProfile() {
	return request({
		url: '/mhotel/idcgetSumData.action',
		method: 'get'
	})
}

// 今日访问量
export function getIdcvisitsToday() {
	return request({
		url: '/mhotel/idcvisitsToday.action',
		method: 'post'
	})
}

// 访问量趋势
export function getIdcvisitsDiyQuery(param) {
	let data = new FormData();
	data.append('type', param.type);
	if (param.startTime !== undefined && param.endTime !== undefined) {
		data.append('startTime', param.startTime);
		data.append('endTime', param.endTime);
	}

	return request({
		url: '/mhotel/idcvisitsDiyQuery.action',
		method: 'post',
		data
	})
}