import request from '@/utils/request'

/**
 * 查询订单
 * @param {*} data 
 * @returns 
 */
export function tbOrderInfoData(data) {
    return request({
        url: '/api/tbOrderInfo/date',
        method: 'post',
        data: {
            shopId: localStorage.getItem('shopId'),
            ...data
        }
    })
}

/**
 * 导出数据
 * @param {*} data
 * @returns 
 */
export function tbOrderInfoDownload(data) {
    return request({
        url: '/api/tbOrderInfo/download',
        method: 'post',
        data: {
            shopId: localStorage.getItem('shopId'),
            ...data
        },
        responseType: 'blob'
    })
}

/**
 * 通过Id查询订单
 * @param {*} id 
 * @returns 
 */
export function tbOrderInfoDetail(id) {
    return request({
        url: `/api/tbOrderInfo/${id}`,
        method: 'get'
    })
}

/**
 * 通过Id查询订单
 * @param {*} id 
 * @returns 
 */
export function payCount() {
    return request({
        url: `/api/tbOrderInfo/payCount`,
        method: 'get',
        params: {
            shopId: localStorage.getItem('shopId')
        }
    })
}