// 系统专项设置api文件
import request from '@/utils/request'
import qs from 'qs'
let api = '/api-web'

// 获取学生列表
export function queryStudentList (data) {
  return request({
    url: api + '/studentManage/queryStudentList',
    method: 'get',
    params: data
  })
}

// 获取学生vip课
export function findStudentVipGroupClass (data) {
  return request({
    url: api + `/studentManage/findStudentVipGroupClass`,
    method: 'get',
    params: data
  })
}


// 根据学生ID获取学生基本报名信息
export function findStudentBaseInfo (data) {
  return request({
    url: api + '/studentManage/findStudentBaseInfo',
    method: 'get',
    params: data
  })
}

// 根据学生ID获取其所在的乐团
export function findStudentMusicGroups (data) {
  return request({
    url: api + `/studentManage/findStudentMusicGroups`,
    method: 'get',
    params: data
  })
}

// 根据乐团获取排课列表
export function findStudentCourses (data) {
  return request({
    url: api + `/studentManage/findStudentCourses`,
    method: 'get',
    params: data
  })
}

// 获取学生vip课
export function findStudentVipGroups (data) {
  return request({
    url: api + `/studentManage/findStudentVipGroups`,
    method: 'get',
    params: data
  })
}

// // 获取学生签到列表
// export function findStudentAttendances (data) {
//   return request({
//     url: api + `/studentManage/findStudentAttendances`,
//     method: 'get',
//     params: data
//   })
// }

// 提现分页查询
export function studentWithdraw (data) {
  return request({
    url: api + `/studentWithdraw/queryPage`,
    method: 'get',
    params: data
  })
}

// 获取学员扣费记录列表
export function queryStudentPayment (data) {
  return request({
    url: api + `/studentManage/queryStudentPayment`,
    method: 'get',
    params: data
  })
}

// 获取学员订单列表
export function studentPaymentOrderList (data) {
  return request({
    url: api + `/order/queryPage`,
    method: 'get',
    params: data
  })
}

// 获取用户默认账户基本信息
export function getUserCashAccountBaseInfo (data) {
  return request({
    url: api + `/studentManage/getUserCashAccountBaseInfo`,
    method: 'get',
    params: data
  })
}

// 修改学生报名专业
export function resetStudentSubject (data) {
  return request({
    url: api + `/studentRegistration/batchUpdateSubject`,
    method: 'post',
    data: qs.stringify(data)
  })
}

//学生报名缴费金额详情
export function getStudentFeeDetail (data) {
  return request({
    url: api + `/studentRegistration/queryFeeDetail`,
    method: 'get',
    params: data
  })
}

// 根据学生id获取

// 获取学生点名总览
export function getStudentRecord (data) {
  return request({
    url: api + `/studentManage/queryMusicGroupStudentsSign`,
    method: 'get',
    params: data
  })
}

// 添加学员
export function addStudent (data) {
  return request({
    url: api + `/studentRegistration/insertStudent`,
    method: 'POST',
    data: data
  })
}

// 根据班级id获取班级内所有学生
export function getClassAllStudent (data) {
  return request({
    url: api + `/classGroupStudent/findAllStudent`,
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 添加学生 addStudents
export function addStudents (data) {
  return request({
    url: api + `/classGroupStudent/addStudents`,
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 删除学生
export function removeStudents (data) {
  return request({
    url: api + `/classGroupStudent/del`,
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 根据学生id查看学生班级
export function getStudentClass (data) {
  return request({
    url: api + `/studentManage/queryStudentClassGroup`,
    method: 'get',
    params: data
  })
}

// 更新指定用户的账户课程余额
export function updateCourseBalance (data) {
  return request({
    url: api + `/userCashAccount/updateCourseBalance`,
    method: 'post',
    data: qs.stringify(data)
  })
}

// 更新指定用户的账户可用余额
export function updateBalance (data) {
  return request({
    url: api + `/userCashAccount/updateBalance`,
    method: 'post',
    data: qs.stringify(data)
  })
}

// 根据手机号获取学生信息
export function getStudentInfoByPhone (data) {
  return request({
    url: api + `/studentManage/queryUserByPhone`,
    method: 'get',
    params: data
  })
}

// 添加学生 studentManage/register
export function registerStudent (data) {
  return request({
    url: api + `/studentManage/register`,
    method: 'post',
    data: qs.stringify(data)
  })
}

// 更新学生信息
export function updateStudent (data) {
  return request({
    url: api + `/studentManage/studentUpdate`,
    method: 'post',
    data: qs.stringify(data)
  })
}

// 账户余额充值
export function transferCourseBalanceToBalance (data) {
  return request({
    url: api + `/userCashAccount/transferCourseBalanceToBalance`,
    method: 'post',
    data: qs.stringify(data)
  })
}


// 学生对外课 findStudentCourseGroupsWithWeb
export function findStudentCourseGroupsWithWeb (data) {
  return request({
    url: api + `/coursesGroupController/findStudentCourseGroupsWithWeb`,
    method: 'get',
    params: data
  })
}

// 账户流水列表
export function userCashAccountDetail (data) {
  return request({
    url: api + `/userCashAccountDetail/queryPage`,
    method: 'get',
    params: data
  })
}

// 课程余额流水列表
export function userCoursesAccount (data) {
  return request({
    url: api + `/userCoursesAccount/queryPage`,
    method: 'get',
    params: data
  })
}

// 查看学员协议
export function getLatest (data) {
  return request({
    url: api + `/sysUserContracts/getLatest`,
    method: 'get',
    params: data
  })
}
