Skip to content

Commit 566a53b

Browse files
Merge pull request #68 from lienze741/1.2.x
公众号数据统计
2 parents 415560b + 1bd4028 commit 566a53b

File tree

4 files changed

+601
-0
lines changed

4 files changed

+601
-0
lines changed
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: EZ
5+
* Date: 2020/5/19
6+
* Time: 23:44
7+
*/
8+
9+
namespace EasySwoole\WeChat\Bean\OfficialAccount;
10+
11+
use EasySwoole\Spl\SplBean;
12+
use EasySwoole\Spl\SplArray;
13+
14+
15+
class DataCubeRequest extends SplBean
16+
{
17+
protected $begin_date;
18+
protected $start_date;
19+
protected $end_date;
20+
protected $page;
21+
protected $page_size;
22+
protected $ad_slot;
23+
24+
25+
protected $list;
26+
protected $base_resp;
27+
protected $summary;
28+
protected $total_num;
29+
30+
31+
/**
32+
* @return SplArray
33+
*/
34+
public function buildRequest() : SplArray
35+
{
36+
$data = $this->toArray(null, SplBean::FILTER_NOT_NULL);
37+
38+
return new SplArray($data);
39+
}
40+
41+
public function setAdSlot($adSlot)
42+
{
43+
$this->ad_slot = $adSlot;
44+
}
45+
46+
public function getAdSlot()
47+
{
48+
return $this->ad_slot;
49+
}
50+
51+
public function setTotalNum($totalNum)
52+
{
53+
$this->total_num = $totalNum;
54+
}
55+
56+
public function getTotalNum()
57+
{
58+
return $this->total_num;
59+
}
60+
61+
public function setSummary($summary)
62+
{
63+
$this->summary = $summary;
64+
}
65+
66+
public function getSummary()
67+
{
68+
return $this->summary;
69+
}
70+
71+
public function setBaseResp($baseResp)
72+
{
73+
$this->base_resp = $baseResp;
74+
}
75+
76+
public function getBaseResp()
77+
{
78+
return $this->base_resp;
79+
}
80+
81+
/**
82+
* @param string $beginDate
83+
*/
84+
public function setBeginDate(string $beginDate) :void
85+
{
86+
$this->begin_date = $beginDate;
87+
}
88+
89+
/**
90+
* @return null|string
91+
*/
92+
public function getBeginDate() : ?string
93+
{
94+
return $this->begin_date;
95+
}
96+
/**
97+
* @param string $endDate
98+
*/
99+
public function setEndDate(string $endDate) :void
100+
{
101+
$this->end_date = $endDate;
102+
}
103+
104+
/**
105+
* @return null|string
106+
*/
107+
public function getEndDate() : ?string
108+
{
109+
return $this->end_date;
110+
}
111+
112+
/**
113+
* @param $list
114+
*/
115+
public function setList($list)
116+
{
117+
$this->list = $list;
118+
}
119+
120+
public function getList()
121+
{
122+
return $this->list;
123+
}
124+
125+
public function setPage($page)
126+
{
127+
$this->page = $page;
128+
}
129+
130+
public function getPage()
131+
{
132+
return $this->page;
133+
}
134+
135+
public function setPageSize($pageSize)
136+
{
137+
$this->page_size = $pageSize;
138+
}
139+
140+
public function getPageSize()
141+
{
142+
return $this->page_size;
143+
}
144+
145+
public function setStartDate($startDate)
146+
{
147+
$this->start_date= $startDate;
148+
}
149+
150+
public function getStartDate()
151+
{
152+
return $this->start_date;
153+
}
154+
155+
156+
157+
158+
}

src/OfficialAccount/ApiUrl.php

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,106 @@ class ApiUrl
508508
*/
509509
const JSAPI_GET_TICKET = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi';
510510

511+
/**
512+
* 获取用户增减数据
513+
*/
514+
const GET_USER_SUMMARY = 'https://api.weixin.qq.com/datacube/getusersummary?access_token=ACCESS_TOKEN';
515+
516+
/**
517+
* 获取累计用户数据
518+
*/
519+
const GET_USER_CUMULATE = 'https://api.weixin.qq.com/datacube/getusercumulate?access_token=ACCESS_TOKEN';
520+
521+
/**
522+
* 获取图文群发每日数据
523+
*/
524+
const GET_ARTICLE_SUMMARY = 'https://api.weixin.qq.com/datacube/getarticlesummary?access_token=ACCESS_TOKEN';
525+
526+
/**
527+
* 获取图文群发总数据
528+
*/
529+
const GET_ARTICLE_TOTAL = 'https://api.weixin.qq.com/datacube/getarticletotal?access_token=ACCESS_TOKEN';
530+
531+
/**
532+
* 获取图文统计数据
533+
*/
534+
const GET_USER_READ = 'https://api.weixin.qq.com/datacube/getuserread?access_token=ACCESS_TOKEN';
535+
536+
/**
537+
* 获取图文统计分时数据
538+
*/
539+
const GET_USER_READ_HOUR = 'https://api.weixin.qq.com/datacube/getuserreadhour?access_token=ACCESS_TOKEN';
540+
541+
/**
542+
* 获取图文分享转发数据
543+
*/
544+
const GET_USER_SHARE = 'https://api.weixin.qq.com/datacube/getusershare?access_token=ACCESS_TOKEN';
545+
546+
/**
547+
* 获取图文分享转发分时数据
548+
*/
549+
const GET_USER_SHARE_HOUR = 'https://api.weixin.qq.com/datacube/getusersharehour?access_token=ACCESS_TOKEN';
550+
551+
/**
552+
* 获取消息发送概况数据
553+
*/
554+
const GET_UP_STREAM_MSG = 'https://api.weixin.qq.com/datacube/getupstreammsg?access_token=ACCESS_TOKEN';
555+
556+
/**
557+
* 获取消息分送分时数据
558+
*/
559+
const GET_UP_STREAM_MSG_HOUR = 'https://api.weixin.qq.com/datacube/getupstreammsghour?access_token=ACCESS_TOKEN';
560+
561+
/**
562+
* 获取消息发送周数据
563+
*/
564+
const GET_UP_STREAM_MSG_WEEK = 'https://api.weixin.qq.com/datacube/getupstreammsgweek?access_token=ACCESS_TOKEN';
565+
566+
/**
567+
* 获取消息发送月数据
568+
*/
569+
const GET_UP_STREAM_MSG_MONTH = 'https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token=ACCESS_TOKEN';
570+
571+
/**
572+
* 获取消息发送分布数据
573+
*/
574+
const GET_UP_STREAM_MSG_DIST = 'https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token=ACCESS_TOKEN';
575+
576+
/**
577+
* 获取消息发送分布周数据
578+
*/
579+
const GET_UP_STREAM_MSG_DIST_WEEK = 'https://api.weixin.qq.com/datacube/getupstreammsgdistweek?access_token=ACCESS_TOKEN';
580+
581+
/**
582+
* 获取消息发送分布月数据
583+
*/
584+
const GET_UP_STREAM_MSG_DIST_MONTH = 'https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?access_token=ACCESS_TOKEN';
585+
586+
/**
587+
* 获取公众号分广告位数据
588+
*/
589+
const PUBLISHER_ADPOS_GENERAL = 'https://api.weixin.qq.com/publisher/stat?action=publisher_adpos_general&access_token=ACCESS_TOKEN';
590+
591+
/**
592+
* 获取公众号返佣商品数据
593+
*/
594+
const PUBLISHER_CPS_GENERAL = 'https://api.weixin.qq.com/publisher/stat?action=publisher_cps_general&access_token=ACCESS_TOKEN';
595+
596+
/**
597+
* 获取公众号结算收入数据及结算主体信息
598+
*/
599+
const PUBLISHER_SETTLEMENT = 'https://api.weixin.qq.com/publisher/stat?action=publisher_settlement&access_token=ACCESS_TOKEN';
600+
601+
/**
602+
* 获取接口分析数据
603+
*/
604+
const GET_INTERFACE_SUMMARY = 'https://api.weixin.qq.com/datacube/getinterfacesummary?access_token=ACCESS_TOKEN';
605+
606+
/**
607+
* 获取接口分析分时数据
608+
*/
609+
const GET_INTERFACE_SUMMARY_HOUR = 'https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token=ACCESS_TOKEN';
610+
511611
/**
512612
* @param string $baseUrl
513613
* @param array $data

0 commit comments

Comments
 (0)