partial #1515
This commit is contained in:
parent
cca68d6f73
commit
a052180696
@ -40,7 +40,23 @@ class Controller_home extends Crunchbutton_Controller_Account {
|
|||||||
|
|
||||||
$graphs = [];
|
$graphs = [];
|
||||||
|
|
||||||
$graphs[ 'Investors Stuff' ] = array_merge(
|
$graphs[ 'Detailed Analytics' ] = array_merge(
|
||||||
|
$chartUsers->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartRevenue->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartChurn->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartGift->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartOrder->getGroups( 'detailed-analytics' )
|
||||||
|
);
|
||||||
|
|
||||||
|
$graphs[ 'Detailed Analytics' ] = array_merge(
|
||||||
|
$chartUsers->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartRevenue->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartChurn->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartGift->getGroups( 'detailed-analytics' ),
|
||||||
|
$chartOrder->getGroups( 'detailed-analytics' )
|
||||||
|
);
|
||||||
|
|
||||||
|
$graphs[ 'Old Graphs' ] = array_merge(
|
||||||
$chartUsers->getGroups(),
|
$chartUsers->getGroups(),
|
||||||
$chartRevenue->getGroups(),
|
$chartRevenue->getGroups(),
|
||||||
$chartChurn->getGroups(),
|
$chartChurn->getGroups(),
|
||||||
@ -48,22 +64,6 @@ class Controller_home extends Crunchbutton_Controller_Account {
|
|||||||
$chartOrder->getGroups()
|
$chartOrder->getGroups()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
$graphs = array(
|
|
||||||
'' => array(
|
|
||||||
// Groups
|
|
||||||
array( 'divId' => 'chart-orders', 'title-group' => 'Orders', 'chart-url' => 'orders-per-day' ),
|
|
||||||
array( 'divId' => 'chart-users-others', 'title-group' => 'Users - Others', 'chart-url' => 'users-unique-per-month' ),
|
|
||||||
array( 'divId' => 'chart-users-active', 'title-group' => 'Active Users', 'chart-url' => 'users-active-per-week' ),
|
|
||||||
array( 'divId' => 'chart-users-new', 'title-group' => 'New Users', 'chart-url' => 'users-new-per-day' ),
|
|
||||||
array( 'divId' => 'chart-gross', 'title-group' => 'Gross Revenue', 'chart-url' => 'gross-revenue-per-week' ),
|
|
||||||
array( 'divId' => 'chart-churn', 'title-group' => 'Churn Rate', 'chart-url' => 'churn-rate-per-week' ),
|
|
||||||
array( 'divId' => 'chart-gift-cards', 'title-group' => 'Gift Cards', 'chart-url' => 'gift-cards-created-per-day' ),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
|
|
||||||
c::view()->graphs = $graphs;
|
c::view()->graphs = $graphs;
|
||||||
c::view()->display('home/index');
|
c::view()->display('home/index');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,23 @@ class Crunchbutton_Chart extends Cana_Model {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGroups(){
|
public function getGroups( $_group = false ){
|
||||||
$groups = [];
|
$groups = [];
|
||||||
foreach( $this->groups as $id_group => $group ){
|
foreach( $this->groups as $id_group => $group ){
|
||||||
|
$add = false;
|
||||||
|
if( $_group ){
|
||||||
|
if( $group[ 'groups' ] && in_array( $_group, $group[ 'groups' ] ) ){
|
||||||
|
$add = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if( !$group[ 'groups' ] ){
|
||||||
|
$add = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( !$add ){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$groups[ $id_group ] = array();
|
$groups[ $id_group ] = array();
|
||||||
$groups[ $id_group ][ 'title' ] = $group[ 'title' ];
|
$groups[ $id_group ][ 'title' ] = $group[ 'title' ];
|
||||||
$charts = $group[ 'charts' ];
|
$charts = $group[ 'charts' ];
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class Crunchbutton_Chart_Giftcard extends Crunchbutton_Chart {
|
|||||||
),
|
),
|
||||||
'group-giftcards-redeemed' => array(
|
'group-giftcards-redeemed' => array(
|
||||||
'title' => 'Gift card Redeemed',
|
'title' => 'Gift card Redeemed',
|
||||||
|
'groups' => array( 'detailed-analytics' ),
|
||||||
'charts' => array(
|
'charts' => array(
|
||||||
'gift-cards-redeemed-per-day' => array( 'title' => 'Day', 'interval' => 'day', 'type' => 'column', 'method' => 'redeemedByDay', 'filters' => array( array( 'title' => 'By Group', 'type' => 'group', 'method' => 'redeemedPerGroupByDay' ) ) ),
|
'gift-cards-redeemed-per-day' => array( 'title' => 'Day', 'interval' => 'day', 'type' => 'column', 'method' => 'redeemedByDay', 'filters' => array( array( 'title' => 'By Group', 'type' => 'group', 'method' => 'redeemedPerGroupByDay' ) ) ),
|
||||||
'gift-cards-redeemed-per-week' => array( 'title' => 'Week', 'interval' => 'week', 'type' => 'column', 'method' => 'redeemedByWeek', 'filters' => array( array( 'title' => 'By Group', 'type' => 'group', 'method' => 'redeemedPerGroupByWeek' ) ) ),
|
'gift-cards-redeemed-per-week' => array( 'title' => 'Week', 'interval' => 'week', 'type' => 'column', 'method' => 'redeemedByWeek', 'filters' => array( array( 'title' => 'By Group', 'type' => 'group', 'method' => 'redeemedPerGroupByWeek' ) ) ),
|
||||||
|
|||||||
@ -39,18 +39,21 @@ class Crunchbutton_Chart_Order extends Crunchbutton_Chart {
|
|||||||
),
|
),
|
||||||
'group-orders-by-weekday-by-community' => array(
|
'group-orders-by-weekday-by-community' => array(
|
||||||
'title' => 'Orders by Weekday by Community',
|
'title' => 'Orders by Weekday by Community',
|
||||||
|
'groups' => array( 'detailed-analytics' ),
|
||||||
'charts' => array(
|
'charts' => array(
|
||||||
'orders-by-weekday-by-community' => array( 'title' => '', 'type' => 'area', 'method' => 'byWeekdayByCommunity' )
|
'orders-by-weekday-by-community' => array( 'title' => '', 'type' => 'area', 'method' => 'byWeekdayByCommunity' )
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'group-orders-per-restaurant-by-community' => array(
|
'group-orders-per-restaurant-by-community' => array(
|
||||||
'title' => 'Orders per Restaurant by Community',
|
'title' => 'Orders per Restaurant by Community',
|
||||||
|
'groups' => array( 'detailed-analytics' ),
|
||||||
'charts' => array(
|
'charts' => array(
|
||||||
'orders-per-restaurant-by-community' => array( 'title' => '', 'type' => 'pie_communities', 'method' => 'perRestaurantPerCommunity' )
|
'orders-per-restaurant-by-community' => array( 'title' => '', 'type' => 'pie_communities', 'method' => 'perRestaurantPerCommunity' )
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'group-orders-track-frequece' => array(
|
'group-orders-track-frequece' => array(
|
||||||
'title' => 'Track Orders Frequency',
|
'title' => 'Track Orders Frequency',
|
||||||
|
'groups' => array( 'detailed-analytics' ),
|
||||||
'charts' => array(
|
'charts' => array(
|
||||||
'orders-track-frequece' => array( 'title' => 'Orders', 'interval' => 'week', 'type' => 'area', 'method' => 'trackFrequence' ),
|
'orders-track-frequece' => array( 'title' => 'Orders', 'interval' => 'week', 'type' => 'area', 'method' => 'trackFrequence' ),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -5,8 +5,8 @@ class Crunchbutton_Chart_User extends Crunchbutton_Chart {
|
|||||||
public $description = 'Users';
|
public $description = 'Users';
|
||||||
|
|
||||||
public $groups = array(
|
public $groups = array(
|
||||||
|
|
||||||
'group-users-reclaimed' => array(
|
'group-users-reclaimed' => array(
|
||||||
|
'groups' => array( 'detailed-analytics' ),
|
||||||
'title' => 'Reclaimed Users',
|
'title' => 'Reclaimed Users',
|
||||||
'charts' => array(
|
'charts' => array(
|
||||||
'users-reclaimed-per-day' => array( 'title' => 'Day', 'interval' => 'day', 'type' => 'column', 'method' => 'reclaimedByDay' ),
|
'users-reclaimed-per-day' => array( 'title' => 'Day', 'interval' => 'day', 'type' => 'column', 'method' => 'reclaimedByDay' ),
|
||||||
@ -17,6 +17,7 @@ class Crunchbutton_Chart_User extends Crunchbutton_Chart {
|
|||||||
|
|
||||||
'group-users-track-frequece' => array(
|
'group-users-track-frequece' => array(
|
||||||
'title' => 'Track User Frequency',
|
'title' => 'Track User Frequency',
|
||||||
|
'groups' => array( 'detailed-analytics' ),
|
||||||
'charts' => array(
|
'charts' => array(
|
||||||
'users-track-frequece' => array( 'title' => 'Users', 'interval' => 'week', 'type' => 'area', 'method' => 'trackFrequence' ),
|
'users-track-frequece' => array( 'title' => 'Users', 'interval' => 'week', 'type' => 'area', 'method' => 'trackFrequence' ),
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user