import apolloClient from "@/utils/graphql";
|
import gql from "graphql-tag";
|
|
export function getData(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars($staffId: Int!, $keyword: String, $pageIn: PageIn!) {
|
findPlayerByStaff(
|
staffId: $staffId
|
keyword: $keyword
|
pageIn: $pageIn
|
) {
|
ls {
|
id
|
name
|
gender
|
mobile
|
user {
|
id
|
name
|
wxOaOpenId
|
}
|
accs {
|
id
|
voucher {
|
id
|
voucherType
|
name
|
}
|
qty
|
freezeQty
|
amt
|
beginDate
|
endDate
|
modifyTime
|
}
|
}
|
pageOut {
|
total
|
index
|
size
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|
|
export function getNotTeam(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars($staffId: Int!, $keyword: String, $pageIn: PageIn!) {
|
findPlayerNotTeam(
|
staffId: $staffId
|
keyword: $keyword
|
pageIn: $pageIn
|
) {
|
ls {
|
id
|
name
|
gender
|
mobile
|
user {
|
id
|
name
|
wxOaOpenId
|
}
|
accs {
|
id
|
voucher {
|
id
|
voucherType
|
name
|
}
|
qty
|
freezeQty
|
amt
|
beginDate
|
endDate
|
modifyTime
|
}
|
}
|
pageOut {
|
total
|
index
|
size
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|
|
export function getRenew(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars($staffId: Int!, $keyword: String, $pageIn: PageIn!) {
|
findPlayerRenew(staffId: $staffId, keyword: $keyword, pageIn: $pageIn) {
|
ls {
|
id
|
name
|
gender
|
mobile
|
user {
|
id
|
name
|
wxOaOpenId
|
}
|
accs {
|
id
|
voucher {
|
id
|
voucherType
|
name
|
}
|
qty
|
freezeQty
|
amt
|
beginDate
|
endDate
|
modifyTime
|
}
|
}
|
pageOut {
|
total
|
index
|
size
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|
|
export function getExpire(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars($staffId: Int!, $keyword: String, $pageIn: PageIn!) {
|
findPlayerExpire(
|
staffId: $staffId
|
keyword: $keyword
|
pageIn: $pageIn
|
) {
|
ls {
|
id
|
name
|
gender
|
mobile
|
user {
|
id
|
name
|
wxOaOpenId
|
}
|
accs {
|
id
|
voucher {
|
id
|
voucherType
|
name
|
}
|
qty
|
freezeQty
|
amt
|
beginDate
|
endDate
|
modifyTime
|
}
|
}
|
pageOut {
|
total
|
index
|
size
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|
|
export function getDeleted(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars(
|
$staffId: Int!
|
$itemType: ItemType!
|
$keyword: String
|
$pageIn: PageIn!
|
) {
|
findDeletedItem(
|
staffId: $staffId
|
itemType: $itemType
|
keyword: $keyword
|
pageIn: $pageIn
|
) {
|
ls {
|
id
|
name
|
modifyTime
|
}
|
pageOut {
|
total
|
index
|
size
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|
|
export function getDetails(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars($id: Int!) {
|
findPlayerDto(id: $id) {
|
id
|
orgId
|
name
|
gender
|
mobile
|
birthday
|
description
|
user {
|
id
|
name
|
mobile
|
avatars {
|
url1
|
url2
|
url3
|
origin
|
def
|
ext
|
}
|
}
|
avatars {
|
url1
|
url2
|
url3
|
origin
|
def
|
ext
|
}
|
state
|
createTime
|
createById
|
accs {
|
id
|
voucher {
|
id
|
name
|
}
|
voucherType
|
memberType
|
beginDate
|
endDate
|
qty
|
freezeQty
|
amt
|
state
|
}
|
teams {
|
id
|
name
|
}
|
saleMan {
|
id
|
name
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|
//获取课程顾问
|
export function getSaleMan(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars($staffId: Int!, $keyword: String, $pageIn: PageIn) {
|
findStaff(staffId: $staffId, keyword: $keyword, pageIn: $pageIn) {
|
ls {
|
id
|
name
|
gender
|
}
|
pageOut {
|
total
|
index
|
size
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|
//获取课包/会员卡
|
export function getVoucher(params) {
|
return apolloClient.query({
|
query: gql`
|
query vars(
|
$orgId: Int
|
$types: [VoucherType!]!
|
$keyword: String
|
$pageIn: PageIn
|
) {
|
findVoucherByType(
|
orgId: $orgId
|
types: $types
|
keyword: $keyword
|
pageIn: $pageIn
|
) {
|
ls {
|
id
|
orgId
|
name
|
voucherType
|
memberType
|
qty
|
}
|
pageOut {
|
total
|
index
|
size
|
}
|
}
|
}
|
`,
|
variables: params,
|
});
|
}
|