import request from '@/utils/request'
export function recentLive() {
  return request({
    url: '/liveData/liveData/recentLive',
    method: 'get',
  })
}

export function dashboardData(liveId) {
  return request({
    url: '/liveData/liveData/dashboardData' + '?liveId=' +liveId,
    method: 'get'
  })
}

export function listLiveData(data) {
  return request({
    url: '/liveData/liveData/listLiveData',
    method: 'post',
    data:data,
  })
}

export function getLiveDataDetailBySql(liveId) {
  return request({
    url: '/liveData/liveData/getLiveDataDetailBySql?liveId=' + liveId,
    method: 'get'
  })
}

export function getLiveUserDetailListBySql(liveId, pageNum, pageSize) {
  return request({
    url: '/liveData/liveData/getLiveUserDetailListBySql?liveId=' + liveId + '&pageNum=' + (pageNum || 1) + '&pageSize=' + (pageSize || 100),
    method: 'get'
  })
}

export function getLiveDataDetailByServer(liveId) {
  return request({
    url: '/liveData/liveData/getLiveDataDetailByServer?liveId=' + liveId,
    method: 'get'
  })
}

export function getLiveUserDetailListByServer(liveId) {
  return request({
    url: '/liveData/liveData/getLiveUserDetailListByServer?liveId=' + liveId,
    method: 'get'
  })
}

// 导出直播间用户详情数据
export function exportLiveUserDetail(liveId) {
  return request({
    url: '/liveData/liveData/exportLiveUserDetail?liveId=' + liveId,
    method: 'get'
  })
}

// 分公司直播数据统计列表
export function listLiveDataCompany(data) {
  return request({
    url: '/liveData/liveData/listLiveDataCompany',
    method: 'post',
    data: data
  })
}

// 导出分公司直播数据统计
export function exportLiveDataCompany(data) {
  return request({
    url: '/liveData/liveData/exportLiveDataCompany',
    method: 'post',
    data: data
  })
}


// 直播数据统计-数据概览（12项指标）
export function getLiveStatisticsOverview(liveIds) {
  return request({
    url: '/liveData/liveData/getLiveStatisticsOverview',
    method: 'post',
    data: liveIds || []
  })
}

// 直播趋势-进入人数折线图（基于 live_user_first_entry 与直播开始时间的相对时间）
export function getLiveEntryTrend(liveIds) {
  return request({
    url: '/liveData/liveData/getLiveEntryTrend',
    method: 'post',
    data: liveIds || []
  })
}

// 直播间学员列表（分页）
export function listLiveRoomStudents(data) {
  return request({
    url: '/liveData/liveData/listLiveRoomStudents',
    method: 'post',
    data: data || {}
  })
}

// 商品对比统计（商品名称、下单未支付人数、成交人数、成交金额）
export function listProductCompareStats(data) {
  return request({
    url: '/liveData/liveData/listProductCompareStats',
    method: 'post',
    data: data || {}
  })
}

// 邀课对比-分享人选项列表（基于 live_user_first_entry 中存在的销售）
export function listInviteSalesOptions(liveIds) {
  return request({
    url: '/liveData/liveData/listInviteSalesOptions',
    method: 'post',
    data: liveIds || []
  })
}

// 邀课对比统计（归属公司、销售名称、邀请人数、已支付订单数、订单总金额）
export function listInviteCompareStats(data) {
  return request({
    url: '/liveData/liveData/listInviteCompareStats',
    method: 'post',
    data: data || {}
  })
}
