import request from '@/utils/request'

// 查询会员营期列表
export function listPeriod(query) {
  return request({
    url: '/course/period/list',
    method: 'get',
    params: query
  })
}
// 查询会员营期列表
export function getDays(query) {
  return request({
    url: '/course/period/getDays',
    method: 'get',
    params: query
  })
}

// 自定义查询主列表分页
export function pagePeriod(data) {
  return request({
    url: '/course/period/page',
    method: 'post',
    data: data
  })
}

// 查询会员营期详细
export function getPeriod(periodId) {
  return request({
    url: '/course/period/' + periodId,
    method: 'get'
  })
}

// 新增会员营期
export function addPeriod(data) {
  return request({
    url: '/course/period',
    method: 'post',
    data: data
  })
}

// 新增会员营期
export function addCourse(data) {
  return request({
    url: '/course/period/addCourse',
    method: 'post',
    data: data
  })
}

// 新增会员营期
export function updateCourseTime(data) {
  return request({
    url: '/course/period/updateCourseTime',
    method: 'post',
    data: data
  })
}
// 新增会员营期
export function updateCourseDate(data) {
  return request({
    url: '/course/period/updateCourseDate',
    method: 'post',
    data: data
  })
}
// 新增会员营期
export function updateListCourseData(data) {
  return request({
    url: '/course/period/updateListCourseData',
    method: 'post',
    data: data
  })
}

// 修改会员营期
export function updatePeriod(data) {
  return request({
    url: '/course/period',
    method: 'put',
    data: data
  })
}

// 删除会员营期
export function delPeriod(periodId) {
  return request({
    url: '/course/period/' + periodId,
    method: 'delete'
  })
}

// 导出会员营期
export function exportPeriod(query) {
  return request({
    url: '/course/period/export',
    method: 'get',
    params: query
  })
}

// 根据营期id获取公司红包金额列表
export function getPeriodCompanyList(query) {
  return request({
    url: '/course/period/companyList',
    method: 'get',
    params: query
  })
}

// 按照课程批量设置红包金额
export function batchSaveRedPacket(data) {
  return request({
    url: '/course/period/batchRedPacket',
    method: 'post',
    data: data
  })
}

// 获取设置红包金额列表展示
export function getPeriodRedPacketList(query) {
  return request({
    url: '/course/period/redPacketList',
    method: 'get',
    params: query
  })
}

// 按照营期批量设置红包金额
export function batchSaveRedPacketByPeriod(data) {
  return request({
    url: '/course/period/batchRedPacket/byPeriod',
    method: 'post',
    data: data
  })
}

// 按照营期、按课程统计
export function periodCountSelect(data) {
  return request({
    url: '/course/period/periodCount',
    method: 'post',
    data: data
  })
}

// 获取营期选项列表
export function getPeriodListLikeName(query) {
  return request({
    url: '/course/period/getPeriodListLikeName',
    method: 'get',
    params: query
  })
}

// 营期课程上移下移
export function periodCourseMove(data) {
  return request({
    url: '/course/period/courseMove',
    method: 'put',
    params: data
  })
}

// 结束营期
export function closePeriod(query) {
  return request({
    url: '/course/period/closePeriod',
    method: 'post',
    params: query
  })
}
