Skip to content

Commit

Permalink
公众号数据统计
Browse files Browse the repository at this point in the history
  • Loading branch information
lienze741 committed May 22, 2020
1 parent f84778c commit ab34818
Show file tree
Hide file tree
Showing 4 changed files with 601 additions and 0 deletions.
158 changes: 158 additions & 0 deletions src/Bean/OfficialAccount/DataCubeRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?php
/**
* Created by PhpStorm.
* User: EZ
* Date: 2020/5/19
* Time: 23:44
*/

namespace EasySwoole\WeChat\Bean\OfficialAccount;

use EasySwoole\Spl\SplBean;
use EasySwoole\Spl\SplArray;


class DataCubeRequest extends SplBean
{
protected $begin_date;
protected $start_date;
protected $end_date;
protected $page;
protected $page_size;
protected $ad_slot;


protected $list;
protected $base_resp;
protected $summary;
protected $total_num;


/**
* @return SplArray
*/
public function buildRequest() : SplArray
{
$data = $this->toArray(null, SplBean::FILTER_NOT_NULL);

return new SplArray($data);
}

public function setAdSlot($adSlot)
{
$this->ad_slot = $adSlot;
}

public function getAdSlot()
{
return $this->ad_slot;
}

public function setTotalNum($totalNum)
{
$this->total_num = $totalNum;
}

public function getTotalNum()
{
return $this->total_num;
}

public function setSummary($summary)
{
$this->summary = $summary;
}

public function getSummary()
{
return $this->summary;
}

public function setBaseResp($baseResp)
{
$this->base_resp = $baseResp;
}

public function getBaseResp()
{
return $this->base_resp;
}

/**
* @param string $beginDate
*/
public function setBeginDate(string $beginDate) :void
{
$this->begin_date = $beginDate;
}

/**
* @return null|string
*/
public function getBeginDate() : ?string
{
return $this->begin_date;
}
/**
* @param string $endDate
*/
public function setEndDate(string $endDate) :void
{
$this->end_date = $endDate;
}

/**
* @return null|string
*/
public function getEndDate() : ?string
{
return $this->end_date;
}

/**
* @param $list
*/
public function setList($list)
{
$this->list = $list;
}

public function getList()
{
return $this->list;
}

public function setPage($page)
{
$this->page = $page;
}

public function getPage()
{
return $this->page;
}

public function setPageSize($pageSize)
{
$this->page_size = $pageSize;
}

public function getPageSize()
{
return $this->page_size;
}

public function setStartDate($startDate)
{
$this->start_date= $startDate;
}

public function getStartDate()
{
return $this->start_date;
}




}
100 changes: 100 additions & 0 deletions src/OfficialAccount/ApiUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,106 @@ class ApiUrl
*/
const JSAPI_GET_TICKET = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi';

/**
* 获取用户增减数据
*/
const GET_USER_SUMMARY = 'https://api.weixin.qq.com/datacube/getusersummary?access_token=ACCESS_TOKEN';

/**
* 获取累计用户数据
*/
const GET_USER_CUMULATE = 'https://api.weixin.qq.com/datacube/getusercumulate?access_token=ACCESS_TOKEN';

/**
* 获取图文群发每日数据
*/
const GET_ARTICLE_SUMMARY = 'https://api.weixin.qq.com/datacube/getarticlesummary?access_token=ACCESS_TOKEN';

/**
* 获取图文群发总数据
*/
const GET_ARTICLE_TOTAL = 'https://api.weixin.qq.com/datacube/getarticletotal?access_token=ACCESS_TOKEN';

/**
* 获取图文统计数据
*/
const GET_USER_READ = 'https://api.weixin.qq.com/datacube/getuserread?access_token=ACCESS_TOKEN';

/**
* 获取图文统计分时数据
*/
const GET_USER_READ_HOUR = 'https://api.weixin.qq.com/datacube/getuserreadhour?access_token=ACCESS_TOKEN';

/**
* 获取图文分享转发数据
*/
const GET_USER_SHARE = 'https://api.weixin.qq.com/datacube/getusershare?access_token=ACCESS_TOKEN';

/**
* 获取图文分享转发分时数据
*/
const GET_USER_SHARE_HOUR = 'https://api.weixin.qq.com/datacube/getusersharehour?access_token=ACCESS_TOKEN';

/**
* 获取消息发送概况数据
*/
const GET_UP_STREAM_MSG = 'https://api.weixin.qq.com/datacube/getupstreammsg?access_token=ACCESS_TOKEN';

/**
* 获取消息分送分时数据
*/
const GET_UP_STREAM_MSG_HOUR = 'https://api.weixin.qq.com/datacube/getupstreammsghour?access_token=ACCESS_TOKEN';

/**
* 获取消息发送周数据
*/
const GET_UP_STREAM_MSG_WEEK = 'https://api.weixin.qq.com/datacube/getupstreammsgweek?access_token=ACCESS_TOKEN';

/**
* 获取消息发送月数据
*/
const GET_UP_STREAM_MSG_MONTH = 'https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token=ACCESS_TOKEN';

/**
* 获取消息发送分布数据
*/
const GET_UP_STREAM_MSG_DIST = 'https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token=ACCESS_TOKEN';

/**
* 获取消息发送分布周数据
*/
const GET_UP_STREAM_MSG_DIST_WEEK = 'https://api.weixin.qq.com/datacube/getupstreammsgdistweek?access_token=ACCESS_TOKEN';

/**
* 获取消息发送分布月数据
*/
const GET_UP_STREAM_MSG_DIST_MONTH = 'https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?access_token=ACCESS_TOKEN';

/**
* 获取公众号分广告位数据
*/
const PUBLISHER_ADPOS_GENERAL = 'https://api.weixin.qq.com/publisher/stat?action=publisher_adpos_general&access_token=ACCESS_TOKEN';

/**
* 获取公众号返佣商品数据
*/
const PUBLISHER_CPS_GENERAL = 'https://api.weixin.qq.com/publisher/stat?action=publisher_cps_general&access_token=ACCESS_TOKEN';

/**
* 获取公众号结算收入数据及结算主体信息
*/
const PUBLISHER_SETTLEMENT = 'https://api.weixin.qq.com/publisher/stat?action=publisher_settlement&access_token=ACCESS_TOKEN';

/**
* 获取接口分析数据
*/
const GET_INTERFACE_SUMMARY = 'https://api.weixin.qq.com/datacube/getinterfacesummary?access_token=ACCESS_TOKEN';

/**
* 获取接口分析分时数据
*/
const GET_INTERFACE_SUMMARY_HOUR = 'https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token=ACCESS_TOKEN';

/**
* @param string $baseUrl
* @param array $data
Expand Down
Loading

0 comments on commit ab34818

Please sign in to comment.