import request from '@/utils/request'

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

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

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

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

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

// 今日访问量
export function getIdcvisitsToday() {
	return request({
		url: '/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: '/idcvisitsDiyQuery.action',
		method: 'post',
		data
	})
}