import request from '@/utils/request';

/**
 * 查询订单列表
 * @param params 查询条件
 */
export async function listGroupsWin(params) {
  const res = await request.get('/sylive/groupsWin', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 导出订单
 * @param params 查询条件
 */
export async function exportGroupsWin(params) {
  const res = await request.get('/sylive/groupsWin/export', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 中奖类型
 * @param params 查询条件
 */
export async function getGroupsWinType(params) {
  const res = await request.get('/sylive/groupsWin/win_type', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
