/**
 * 团购订单
 */
import request from '@/utils/request';

/**
 * 分页查询拼团未付款订单
 *
 * @param query 查询参数
 */
export function queryNotPayGroupOrders(query) {
  return request({
    url: 'querystorenotpaygrouporders',
    method: 'get',
    params: query
  })
}


/**
 * 导出所有订单
 * @param status 订单状态
 */
export function exportAllOrder(status) {
  return request({
    url: 'nopay/exportstoreallgrouporder',
    method: 'post',
    responseType: 'arraybuffer'
  })
}

/**
 * 导出选择订单
 */
export function exportCheckedGroupOrder(ids) {
  return request({
    url: 'nopay/exportstorecheckedgrouporder',
    method: 'post',
    params: {ids: ids},
    responseType: 'arraybuffer'
  })
}


/**
 * 确认订单
 * @param id 订单id
 * @param storeId 店铺id
 * @param reason 原因
 */
export function confirmStoreGroupOrder(id, storeId, reason) {
  return request({
    url: 'group/confirmstoreorder/' + id + '/' + storeId,
    method: 'put',
    params: reason
  })
}
