Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

SUMMARY_TREND

SUMMARY_TREND = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailysummarytrend'

DAILY_VISIT_TREND

DAILY_VISIT_TREND = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend'

WEEKLY_VISIT_TREND

WEEKLY_VISIT_TREND = 'https://api.weixin.qq.com/datacube/getweanalysisappidweeklyvisittrend'

MONTHLY_VISIT_TREND

MONTHLY_VISIT_TREND = 'https://api.weixin.qq.com/datacube/getweanalysisappidmonthlyvisittrend'

VISIT_DISTRIBUTION

VISIT_DISTRIBUTION = 'https://api.weixin.qq.com/datacube/getweanalysisappidvisitdistribution'

DAILY_RETAIN_INFO

DAILY_RETAIN_INFO = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailyretaininfo'

WEEKLY_RETAIN_INFO

WEEKLY_RETAIN_INFO = 'https://api.weixin.qq.com/datacube/getweanalysisappidweeklyretaininfo'

MONTHLY_RETAIN_INFO

MONTHLY_RETAIN_INFO = 'https://api.weixin.qq.com/datacube/getweanalysisappidmonthlyretaininfo'

VISIT_PAGE

VISIT_PAGE = 'https://api.weixin.qq.com/datacube/getweanalysisappidvisitpage'

USER_PORTRAIT

USER_PORTRAIT = 'https://api.weixin.qq.com/datacube/getweanalysisappiduserportrait'

Properties

$config

$config : array

Mini program config.

Type

array

$maxRetries

$maxRetries : integer

Type

integer

Methods

setHttp()

setHttp(\EasyWeChat\Core\Http  $http) : $this

Set the http instance.

Parameters

\EasyWeChat\Core\Http $http

Returns

$this

setAccessToken()

setAccessToken(\EasyWeChat\Core\AccessToken  $accessToken) : $this

Set the request token.

Parameters

\EasyWeChat\Core\AccessToken $accessToken

Returns

$this

maxRetries()

maxRetries(integer  $retries) 

Parameters

integer $retries

parseJSON()

parseJSON(string  $method, array  $args) : \EasyWeChat\Support\Collection

Parse JSON from response and check error.

Parameters

string $method
array $args

Throws

\EasyWeChat\Core\Exceptions\HttpException

Returns

\EasyWeChat\Support\Collection

| null

summaryTrend()

summaryTrend(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get summary trend.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

dailyVisitTrend()

dailyVisitTrend(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get daily visit trend.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

weeklyVisitTrend()

weeklyVisitTrend(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get weekly visit trend.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

monthlyVisitTrend()

monthlyVisitTrend(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get monthly visit trend.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

visitDistribution()

visitDistribution(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get visit distribution.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

dailyRetainInfo()

dailyRetainInfo(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get daily retain info.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

weeklyRetainInfo()

weeklyRetainInfo(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get weekly retain info.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

montylyRetainInfo()

montylyRetainInfo(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get monthly retain info.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

visitPage()

visitPage(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get visit page.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

userPortrait()

userPortrait(string  $from, string  $to) : \EasyWeChat\Support\Collection

Get user portrait.

Parameters

string $from
string $to

Returns

\EasyWeChat\Support\Collection

registerHttpMiddlewares()

registerHttpMiddlewares() 

Register Guzzle middlewares.

accessTokenMiddleware()

accessTokenMiddleware() : \Closure

Attache access token to request query.

Returns

\Closure

logMiddleware()

logMiddleware() : \Closure

Log the request.

Returns

\Closure

retryMiddleware()

retryMiddleware() : \Closure

Return retry middleware.

Returns

\Closure

checkAndThrow()

checkAndThrow(array  $contents) 

Check the array data errors, and Throw exception when the contents contains error.

Parameters

array $contents

Throws

\EasyWeChat\Core\Exceptions\HttpException

query()

query(  $api, string  $from, string  $to) : \EasyWeChat\Support\Collection

Unify query.

Parameters

$api
string $from
string $to

Returns

\EasyWeChat\Support\Collection