import request from '@/utils/request'

// 查询订单详情列表
export function listLiveOrderPayments(query, refundDateRange) {
  if (null != refundDateRange && '' != refundDateRange && refundDateRange.length === 2) {
    query.refundBeginTime = refundDateRange[0];
    query.refundEndTime = refundDateRange[1];
  } else {
    query.refundBeginTime = null;
    query.refundEndTime = null;
  }
  return request({
    url: '/live/order/payment',
    method: 'get',
    params: query
  })
}
// 查询订单详情列表
export function exportLiveOrderPayments(query, refundDateRange) {
  if (null != refundDateRange && '' != refundDateRange && refundDateRange.length === 2) {
    query.refundBeginTime = refundDateRange[0];
    query.refundEndTime = refundDateRange[1];
  } else {
    query.refundBeginTime = null;
    query.refundEndTime = null;
  }
  return request({
    url: '/live/order/payment/export',
    method: 'get',
    params: query
  })
}

// 查询支付明细详细
export function getLivePayment(paymentId) {
  return request({
    url: '/live/order/payment/' + paymentId,
    method: 'get'
  })
}

// 修改支付明细
export function updateLivePayment(data) {
  return request({
    url: '/live/order/payment',
    method: 'put',
    data: data
  })
}
