import request from '@/utils/request'

// 查询注册送券活动列表
export function listCouponInfo(query) {
  return request({
    url: '/mapi/activity/couponInfo/list',
    method: 'get',
    params: query
  })
}

// 查询注册送券活动详细
export function getInfo(id) {
  return request({
    url: '/mapi/activity/couponInfo/getInfo',
    method: 'get',
    params: {id: id}
  })
}

// 新增注册送券活动
export function addCouponInfo(data) {
  return request({
    url: '/mapi/activity/couponInfo',
    method: 'post',
    data: data
  })
}

// 修改注册送券活动
export function updateCouponInfo(data) {
  return request({
    url: '/mapi/activity/couponInfo',
    method: 'put',
    data: data
  })
}

// 删除注册送券活动
export function delCouponInfo(id) {
  return request({
    url: '/mapi/activity/couponInfo/' + id,
    method: 'delete'
  })
}


// 修改注册送券活动状态
export function updateCouponInfoStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/activity/couponInfo/updateStatus',
    method: 'post',
    data: data
  })
}


// 查询门店适用的注册活动和优惠券列表
export function listByStore(data) {
  return request({
    url: '/mapi/activity/couponInfo/listByStore',
    method: 'post',
    data: data
  })
}

// 查询门店发券统计-今日统计数量
export function todayCouponSendCountByStore() {
  return request({
    url: '/mapi/activity/couponInfo/todayCouponSendCountByStore',
    method: 'get'
  })
}

// 查询门店发券统计-列表统计
export function listCouponSendCount(data) {
  return request({
    url: '/mapi/activity/couponInfo/listCouponSendCount',
    method: 'post',
    data: data
  })
}
