import request from '@/utils/request'

/**
 * 汇总数据
 * @returns
 */
export function summaryGet() {
    return request({
        url: '/api/summary',
        method: 'get',
        params: {
            shopId: localStorage.getItem('shopId')
        }
    })
}

/**
 * 今日数据
 * @returns
 */
export function summaryTodayGet() {
    return request({
        url: '/api/summary/today',
        method: 'get',
        params: {
            shopId: localStorage.getItem('shopId')
        }
    })
}

/**
 * 今日数据
 * @returns
 */
export function summaryDateGet(day) {
    return request({
        url: '/api/summary/date',
        method: 'get',
        params: {
            shopId: localStorage.getItem('shopId'),
            day: day
        }
    })
}

/**
 * 销售额柱状图
 * @returns
 */
export function dateAmount(day) {
    return request({
        url: '/api/summary/dateAmount',
        method: 'get',
        params: {
            shopId: localStorage.getItem('shopId'),
            day: day
        }
    })
}

/**
 * 商品销售排行
 * @returns
 */
export function dateProduct(day, page) {
    return request({
        url: '/api/summary/dateProduct',
        method: 'get',
        params: {
            shopId: localStorage.getItem('shopId'),
            day: day,
            page: page
        }
    })
}

/**
 * 支付类型占比
 * @returns
 */
export function datePayType(day) {
    return request({
        url: '/api/summary/datePayType',
        method: 'get',
        params: {
            shopId: localStorage.getItem('shopId'),
            day: day
        }
    })
}

