1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Freyo\MtaH5\Source; |
4
|
|
|
|
5
|
|
|
use Freyo\MtaH5\Kernel\BaseClient; |
6
|
|
|
|
7
|
|
|
class Client extends BaseClient |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* 按天查询外部同站链接带来的流量情情况. |
11
|
|
|
* |
12
|
|
|
* @see https://mta.qq.com/docs/h5_api.html#%E5%A4%96%E9%83%A8%E9%93%BE%E6%8E%A5 |
13
|
|
|
* |
14
|
|
|
* @param string $startDate 开始时间(Y-m-d) |
15
|
|
|
* @param string $endDate 结束时间(Y-m-d) |
16
|
|
|
* @param array|string $urls url地址 |
17
|
|
|
* |
18
|
|
|
* @throws \Freyo\MtaH5\Kernel\Exceptions\InvalidConfigException |
19
|
|
|
* |
20
|
|
|
* @return array|\Freyo\MtaH5\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
21
|
|
|
*/ |
22
|
|
|
public function query($startDate, $endDate, $urls) |
23
|
|
|
{ |
24
|
|
|
$params = [ |
25
|
|
|
'start_date' => $startDate, |
26
|
|
|
'end_date' => $endDate, |
27
|
|
|
'urls' => implode((array) $urls, ','), |
|
|
|
|
28
|
|
|
'idx' => 'pv,uv,vv,iv', |
29
|
|
|
]; |
30
|
|
|
|
31
|
|
|
return $this->httpGet('ctr_source_out', $params); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* 按天查询用户最后访问的进入次数与跳出率. |
36
|
|
|
* |
37
|
|
|
* @see https://mta.qq.com/docs/h5_api.html#%E5%85%A5%E5%8F%A3%E9%A1%B5%E9%9D%A2 |
38
|
|
|
* |
39
|
|
|
* @param string $startDate 开始时间(Y-m-d) |
40
|
|
|
* @param string $endDate 结束时间(Y-m-d) |
41
|
|
|
* @param array|string $urls url地址 |
42
|
|
|
* |
43
|
|
|
* @throws \Freyo\MtaH5\Kernel\Exceptions\InvalidConfigException |
44
|
|
|
* |
45
|
|
|
* @return array|\Freyo\MtaH5\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
46
|
|
|
*/ |
47
|
|
|
public function land($startDate, $endDate, $urls) |
48
|
|
|
{ |
49
|
|
|
$params = [ |
50
|
|
|
'start_date' => $startDate, |
51
|
|
|
'end_date' => $endDate, |
52
|
|
|
'urls' => implode((array) $urls, ','), |
|
|
|
|
53
|
|
|
'idx' => 'pv,uv,vv,iv', |
54
|
|
|
]; |
55
|
|
|
|
56
|
|
|
return $this->httpGet('ctr_page_land', $params); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* 按天查询最后访问页面的离次数. |
61
|
|
|
* |
62
|
|
|
* @see https://mta.qq.com/docs/h5_api.html#%E7%A6%BB%E5%BC%80%E9%A1%B5%E9%9D%A2 |
63
|
|
|
* |
64
|
|
|
* @param string $startDate 开始时间(Y-m-d) |
65
|
|
|
* @param string $endDate 结束时间(Y-m-d) |
66
|
|
|
* @param array $urls url地址 |
67
|
|
|
* |
68
|
|
|
* @throws \Freyo\MtaH5\Kernel\Exceptions\InvalidConfigException |
69
|
|
|
* |
70
|
|
|
* @return array|\Freyo\MtaH5\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
71
|
|
|
*/ |
72
|
|
|
public function leave($startDate, $endDate, $urls) |
73
|
|
|
{ |
74
|
|
|
$params = [ |
75
|
|
|
'start_date' => $startDate, |
76
|
|
|
'end_date' => $endDate, |
77
|
|
|
'urls' => implode((array) $urls, ','), |
|
|
|
|
78
|
|
|
'idx' => 'pv,uv,vv,iv', |
79
|
|
|
]; |
80
|
|
|
|
81
|
|
|
return $this->httpGet('ctr_page_exit', $params); |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.