1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the overtrue/wechat. |
5
|
|
|
* |
6
|
|
|
* (c) overtrue <[email protected]> |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the MIT license that is bundled |
9
|
|
|
* with this source code in the file LICENSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace EasyWeChat\OfficialAccount\WiFi; |
13
|
|
|
|
14
|
|
|
use EasyWeChat\Kernel\BaseClient; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Class Client. |
18
|
|
|
* |
19
|
|
|
* @author her-cat <[email protected]> |
20
|
|
|
*/ |
21
|
|
|
class Client extends BaseClient |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* Get Wi-Fi statistics. |
25
|
|
|
* |
26
|
|
|
* @param string $beginDate |
27
|
|
|
* @param string $endDate |
28
|
|
|
* @param int $shopId |
29
|
|
|
* |
30
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
31
|
|
|
* |
32
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
33
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
34
|
|
|
*/ |
35
|
|
|
public function summary(string $beginDate, string $endDate, int $shopId = -1) |
36
|
|
|
{ |
37
|
|
|
$data = [ |
38
|
|
|
'begin_date' => $beginDate, |
39
|
|
|
'end_date' => $endDate, |
40
|
|
|
'shop_id' => $shopId, |
41
|
|
|
]; |
42
|
|
|
|
43
|
|
|
return $this->httpPostJson('bizwifi/statistics/list', $data); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Get the material QR code. |
48
|
|
|
* |
49
|
|
|
* @param int $shopId |
50
|
|
|
* @param string $ssid |
51
|
|
|
* @param int $type |
52
|
|
|
* |
53
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
54
|
|
|
* |
55
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
56
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
57
|
|
|
*/ |
58
|
|
|
public function getQrCodeUrl(int $shopId, string $ssid, int $type = 0) |
59
|
|
|
{ |
60
|
|
|
$data = [ |
61
|
|
|
'shop_id' => $shopId, |
62
|
|
|
'ssid' => $ssid, |
63
|
|
|
'img_id' => $type, |
64
|
|
|
]; |
65
|
|
|
|
66
|
|
|
return $this->httpPostJson('bizwifi/qrcode/get', $data); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Wi-Fi completion page jump applet. |
71
|
|
|
* |
72
|
|
|
* @param array $data |
73
|
|
|
* |
74
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
75
|
|
|
* |
76
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
77
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
78
|
|
|
*/ |
79
|
|
|
public function setFinishPage(array $data) |
80
|
|
|
{ |
81
|
|
|
return $this->httpPostJson('bizwifi/finishpage/set', $data); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* Set the top banner jump applet. |
86
|
|
|
* |
87
|
|
|
* @param array $data |
88
|
|
|
* |
89
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
90
|
|
|
* |
91
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
92
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
93
|
|
|
*/ |
94
|
|
|
public function setHomePage(array $data) |
95
|
|
|
{ |
96
|
|
|
return $this->httpPostJson('bizwifi/homepage/set', $data); |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|