GiftCardPageClient.php
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/*
* This file is part of the overtrue/wechat.
*
* (c) overtrue <i@overtrue.me>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChat\OfficialAccount\Card;
use EasyWeChat\Kernel\BaseClient;
/**
* Class GiftCardPageClient.
*
* @author overtrue <i@overtrue.me>
*/
class GiftCardPageClient extends BaseClient
{
/**
* 创建-礼品卡货架接口.
*
* @param array $attributes
*
* @return mixed
*/
public function add(array $attributes)
{
$params = [
'page' => $attributes,
];
return $this->httpPostJson('card/giftcard/page/add', $params);
}
/**
* 查询-礼品卡货架信息接口.
*
* @param string $pageId
*
* @return mixed
*/
public function get(string $pageId)
{
$params = [
'page_id' => $pageId,
];
return $this->httpPostJson('card/giftcard/page/get', $params);
}
/**
* 修改-礼品卡货架信息接口.
*
* @param string $pageId
* @param string $bannerPicUrl
* @param array $themeList
*
* @return mixed
*/
public function update(string $pageId, string $bannerPicUrl, array $themeList)
{
$params = [
'page' => [
'page_id' => $pageId,
'banner_pic_url' => $bannerPicUrl,
'theme_list' => $themeList,
],
];
return $this->httpPostJson('card/giftcard/page/update', $params);
}
/**
* 查询-礼品卡货架列表接口.
*
* @return mixed
*/
public function list()
{
return $this->httpPostJson('card/giftcard/page/batchget');
}
/**
* 下架-礼品卡货架接口(下架某一个货架或者全部货架).
*
* @param string $pageId
*
* @return mixed
*/
public function setMaintain(string $pageId = '')
{
$params = ($pageId ? ['page_id' => $pageId] : ['all' => true]) + [
'maintain' => true,
];
return $this->httpPostJson('card/giftcard/maintain/set', $params);
}
}