import request from '@/utils/request'
import { URL } from '@/config'

export function getOrderNum(params) {
  return request({
    url: URL.analytics.order.getOrderNum,
    method: 'get',
    params,
  })
}

/**
 * @name 商家端-使用优惠卷数量
 * @api api_url + '/admin/shop/analytics/order/getVoucherActiveNumToday'
 * @returns {
 *  "today": 830.8,   今日
 *  "yestoday": 0,    昨天
 *  "daym2m": null,   
 *  "month": 830.8    月
*}
 */

export function getVoucherActiveNumToday() {
  return request({
    url: URL.analytics.order.getVoucherActiveNumToday,
    method: 'get'
  })
}


export function getVoucherActiveNum(params) {
  return request({
    url: URL.analytics.order.getVoucherActiveNum,
    method: 'get',
    params,
  })
}

/**
 * @name 商家端-订单量
 * @api api_url + '/admin/shop/analytics/order/getOrderNumToday'
 * @returns {
 *  "today": 830.8,   今日
 *  "yestoday": 0,    昨天
 *  "daym2m": null,   
 *  "month": 830.8    月
 *}
 */

export function getOrderNumToday(params) {
  return request({
    url: URL.analytics.order.getOrderNumToday,
    method: 'get',
    params,
  })
}

export function getDashboardTimeLine(params) {
  return request({
    url: URL.analytics.order.getDashboardTimeLine,
    method: 'get',
    params,
  })
}

export function getOrderCustomerNumTimeline(params) {
  return request({
    url: URL.analytics.order.getOrderCustomerNumTimeline,
    method: 'get',
    params,
  })
}

export function getOrderNumTimeline(params) {
  return request({
    url: URL.analytics.order.getOrderNumTimeline,
    method: 'get',
    params,
  })
}

export function getSaleOrderAmount(params) {
  return request({
    url: URL.analytics.order.getSaleOrderAmount,
    method: 'get',
    params,
  })
}

export function getOrderAmount(params) {
  return request({
    url: URL.analytics.order.getOrderAmount,
    method: 'get',
    params,
  })
}

export function getRefundAmount(params) {
  return request({
    url: URL.analytics.order.getRefundAmount,
    method: 'get',
    params,
  })
}

export function getRefundNum(params) {
  return request({
    url: URL.analytics.order.getRefundNum,
    method: 'get',
    params,
  })
}

export function getOrderItemNumTimeLine(params) {
  return request({
    url: URL.analytics.order.getOrderItemNumTimeLine,
    method: 'get',
    params,
  })
}

export function listOrderItemNum(params) {
  return request({
    url: URL.analytics.order.listOrderItemNum,
    method: 'get',
    params,
  })
}

export function getOrderItemNum(params) {
  return request({
    url: URL.analytics.order.getOrderItemNum,
    method: 'get',
    params,
  })
}
