import request from '@/utils/request'

// 分页查询
export const pageList = (query) => {
  return request({
    url: '/member/marketPersons/pageList',
    method: 'get',
    params: query
  })
}

// 新增/修改
export const saveAndEdit = (data) => {
  return request({
    url: '/member/marketPersons/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除模板
export const deleteById = (id) => {
  return request({
    url: '/member/marketPersons/deleteById',
    method: 'delete',
    params: {id:id}
  })
}

// 修改状态
export const updateStatus = (data) => {
  return request({
    url: '/member/marketPersons/insertOrUpdate',
    method: 'post',
    data: data
  })
}

export function getSelectById(id) {
  return request({
    url: '/member/marketPersons/selectById?id=' + id,
    method: 'get'
  })
}

// 提现配置
export const configUpdate = (data) => {
  return request({
    url: '/member/marketPersonsWithdrawConfig/insertOrUpdate',
    method: 'post',
    data: data
  })
}

export function getSetInfo(id) {
  return request({
    url: '/member/marketPersonsWithdrawConfig/info',
    method: 'get'
  })
}

//获取海报信息
export function getPoster() {
  return request({
    url: '/member/marketPersonsPoster/info',
    method: 'get'
  })
}

// 新增/保存海报信息
export const posterUpdate = (data) => {
  return request({
    url: '/member/marketPersonsPoster/insertOrUpdate',
    method: 'post',
    data: data
  })
}

//我的推广码
export function getRetailQrcode(query) {
  return request({
    url: '/member/marketPersons/getRetailQrcode',
    method: 'get',
    params: query
  })
}
