StatisticsService

Implements \StatisticsServiceInterface

Class StatisticsService

Provides the statistic data for the dashboard.

category

System

package

Statistics

Methods

__construct

__construct(\CI_DB_query_builder $db, \xtcPrice $xtcPrice) 

Arguments

$db

\CI_DB_query_builder

$xtcPrice

\xtcPrice

Calculates the average order value.

_calculateAverageOrderValue(double $p_sales, integer $p_ordersCount) : double

Arguments

$p_sales

double

$p_ordersCount

integer

Response

double

Calculates the conversion rate

_calculateConversionRate(integer $p_ordersCount, integer $p_visitorsCount) : double

Arguments

$p_ordersCount

integer

$p_visitorsCount

integer

Response

double

Returns the conversion rate as a formatted number (i.e.: 0,27).

_getAverageOrderValue(double $p_sales, integer $p_ordersCount) : string

Arguments

$p_sales

double

$p_ordersCount

integer

Response

string

Returns the conversion rate as a formatted number (i.e.: 0,27)

_getConversionRate(integer $p_ordersCount, integer $p_visitorsCount) : string

Arguments

$p_ordersCount

integer

$p_visitorsCount

integer

Response

string

Helper function to fetch new customer data of the current day.

_getNewCustomersFromCurrentDayHelper() : array

Response

array

Helper function to fetch new customer data of the current month.

_getNewCustomersFromCurrentMonthHelper() : array

Response

array

Helper function to fetch new customer data of a day time span.

_getNewCustomersFromDayIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Helper function to fetch new customer data of a month time span.

_getNewCustomersFromMonthIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Helper function to fetch order data of the current month.

_getOrdersFromCurrentDayHelper() : array

Response

array

Helper function to fetch order data of the current month.

_getOrdersFromCurrentMonthHelper() : array

Response

array

Helper function to fetch order data of a month time span.

_getOrdersFromDayIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Helper function to fetch order data of a month time span.

_getOrdersFromMonthIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Helper function to fetch sales data of the current day.

_getSalesFromCurrentDayHelper() : array

Response

array

Helper function to fetch sales data of the current month.

_getSalesFromCurrentMonthHelper() : array

Response

array

Helper function to fetch sales data of a day time span.

_getSalesFromDayIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Helper function to fetch sales data of a month time span.

_getSalesFromMonthIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Get Sales Last Month

_getSalesLastMonth() : double

Response

double

Get Sales Last Six Months

_getSalesLastSixMonths() : double

Response

double

Get Sales Last Three Months

_getSalesLastThreeMonths() : double

Response

double

Get Sales Last Two Weeks

_getSalesLastTwoWeeks() : double

Response

double

Get Sales Last Week

_getSalesLastWeek() : double

Response

double

Get Sales Last Year

_getSalesLastYear() : double

Response

double

Get Sales Today

_getSalesToday() : double

Response

double

Helper function to fetch visitors data of the current month.

_getVisitorsFromCurrentDayHelper() : array

Response

array

Helper function to fetch visitors data of the current month.

_getVisitorsFromCurrentMonthHelper() : array

Response

array

Helper function to fetch visitors data of a month time span.

_getVisitorsFromDayIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Helper function to fetch visitors data of a month time span.

_getVisitorsFromMonthIntervalHelper(integer $fromInterval) : array

Arguments

$fromInterval

integer

Response

array

Gets the average order value of the last month as a formatted price (i.e.: 1.234,56 EUR).

getAverageOrderValueLastMonth() : string

Response

string

Gets the average order value of the last six months as a formatted price (i.e.: 1.234,56 EUR).

getAverageOrderValueLastSixMonths() : string

Response

string

Gets the average order value of the last three months as a formatted price (i.e.: 1.234,56 EUR).

getAverageOrderValueLastThreeMonths() : string

Response

string

Gets the average order value of the last two weeks as a formatted price (i.e.: 1.234,56 EUR).

getAverageOrderValueLastTwoWeeks() : string

Response

string

Gets the average order value of the last week as a formatted price (i.e.: 1.234,56 EUR).

getAverageOrderValueLastWeek() : string

Response

string

Gets the average order value of the last year as a formatted price (i.e.: 1.234,56 EUR).

getAverageOrderValueLastYear() : string

Response

string

Gets the average order value of today as a formatted price (i.e.: 1.234,56 EUR).

getAverageOrderValueToday() : string

Response

string

Gets the conversion rate of the last month as a formatted number (i.e.: 0,27)

getConversionRateLastMonth() : string

Response

string

Gets the conversion rate of the last six months as a formatted number (i.e.: 0,27)

getConversionRateLastSixMonths() : string

Response

string

Gets the conversion rate of the last three months as a formatted number (i.e.: 0,27)

getConversionRateLastThreeMonths() : string

Response

string

Gets the conversion rate of the last two weeks as a formatted number (i.e.: 0,27)

getConversionRateLastTwoWeeks() : string

Response

string

Gets the conversion rate of the last week as a formatted number (i.e.: 0,27)

getConversionRateLastWeek() : string

Response

string

Gets the conversion rate of the last year as a formatted number (i.e.: 0,27)

getConversionRateLastYear() : string

Response

string

Gets the conversion rate of today as a formatted number (i.e.: 0,27)

getConversionRateToday() : string

Response

string

Gets the amount of new customers of the last month

getNewCustomersLastMonth() : integer

Response

integer

Gets the amount of new customers of the last six months

getNewCustomersLastSixMonths() : integer

Response

integer

Gets the amount of new customers of the last three months

getNewCustomersLastThreeMonths() : integer

Response

integer

Gets the amount of new customers of the last two week

getNewCustomersLastTwoWeeks() : integer

Response

integer

Gets the amount of new customers of the last week

getNewCustomersLastWeek() : integer

Response

integer

Gets the amount of new customers of the last year

getNewCustomersLastYear() : integer

Response

integer

Get new customer data of the last month.

getNewCustomersStatisticsDataLastMonth() : array

Response

array

Get new customer data of the last six months.

getNewCustomersStatisticsDataLastSixMonth() : array

Response

array

Get new customer data of the last three months.

getNewCustomersStatisticsDataLastThreeMonth() : array

Response

array

Get new customer data of the last two weeks.

getNewCustomersStatisticsDataLastTwoWeeks() : array

Response

array

Get new customer data of the last week.

getNewCustomersStatisticsDataLastWeek() : array

Response

array

Get new customer data of the last year.

getNewCustomersStatisticsDataLastYear() : array

Response

array

Gets the amount of new customers of the current date

getNewCustomersToday() : integer

Response

integer

Gets the orders count of the last month

getOrdersCountLastMonth() : integer

Response

integer

Gets the orders count of the last six months

getOrdersCountLastSixMonths() : integer

Response

integer

Gets the orders count of the last three months

getOrdersCountLastThreeMonths() : integer

Response

integer

Gets the orders count of the last two weeks

getOrdersCountLastTwoWeeks() : integer

Response

integer

Gets the orders count of the last week

getOrdersCountLastWeek() : integer

Response

integer

Gets the orders count of the last year

getOrdersCountLastYear() : integer

Response

integer

Gets the orders count of today

getOrdersCountToday() : integer

Response

integer

Get orders data for the last month.

getOrdersStatisticsDataLastMonth() : array

Response

array

Get orders data for the last two weeks.

getOrdersStatisticsDataLastTwoWeek() : array

Response

array

Get orders data for the last week.

getOrdersStatisticsDataLastWeek() : array

Response

array

Get order data for the last six months.

getOrderStatisticsDataLastSixMonth() : array

Response

array

Get order data for the last three months.

getOrderStatisticsDataLastThreeMonth() : array

Response

array

Get order data for the last year.

getOrderStatisticsDataLastYear() : array

Response

array

Gets the amount of sales of the last month

getSalesLastMonth() : string

Response

string

Gets the amount of sales of the last six months

getSalesLastSixMonths() : string

Response

string

Gets the amount of sales of the last three months

getSalesLastThreeMonths() : string

Response

string

Gets the amount of sales of the last two week

getSalesLastTwoWeeks() : string

Response

string

Gets the amount of sales of the last week

getSalesLastWeek() : string

Response

string

Gets the amount of sales of the last year

getSalesLastYear() : string

Response

string

Get sales data for the last month.

getSalesStatisticsDataLastMonth() : array

Response

array

Get sales data for the last six month.

getSalesStatisticsDataLastSixMonth() : array

Response

array

Get sales data for the last three month.

getSalesStatisticsDataLastThreeMonth() : array

Response

array

Get sales data for the last two weeks.

getSalesStatisticsDataLastTwoWeeks() : array

Response

array

Get sales data for the last week.

getSalesStatisticsDataLastWeek() : array

Response

array

Get sales data for the last year.

getSalesStatisticsDataLastYear() : array

Response

array

Gets the amount of sales of the current date

getSalesToday() : string

Response

string

Gets the amount of users who are currently online.

getUsersOnline() : integer

Response

integer

Gets the amount of visitors of the last month

getVisitorsLastMonth() : integer

Response

integer

Gets the amount of visitors of the last six months

getVisitorsLastSixMonths() : integer

Response

integer

Gets the amount of visitors of the last three months

getVisitorsLastThreeMonths() : integer

Response

integer

Gets the amount of visitors of the last two week

getVisitorsLastTwoWeeks() : integer

Response

integer

Gets the amount of visitors of the last week

getVisitorsLastWeek() : integer

Response

integer

Gets the amount of visitors of the last year

getVisitorsLastYear() : integer

Response

integer

Get visitors data for the last month.

getVisitorsStatisticsDataLastMonth() : array

Response

array

Get visitors data for the last six months.

getVisitorsStatisticsDataLastSixMonth() : array

Response

array

Get visitors data for the last three months.

getVisitorsStatisticsDataLastThreeMonth() : array

Response

array

Get visitors data for the last two weeks.

getVisitorsStatisticsDataLastTwoWeeks() : array

Response

array

Get visitors data for the last week.

getVisitorsStatisticsDataLastWeek() : array

Response

array

Get visitors data for the last six months.

getVisitorsStatisticsDataLastYear() : array

Response

array

Gets the amount of visitors of the current date.

getVisitorsToday() : integer

Response

integer

Properties

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

xtcPrice

xtcPrice : \xtcPrice
var

Type(s)

\xtcPrice

conversionRateDecimalPlaces

conversionRateDecimalPlaces : integer
var

Type(s)

integer

excludeOrderStatusIds

excludeOrderStatusIds : array
var

Type(s)

array