partial #1515
This commit is contained in:
parent
cca68d6f73
commit
a052180696
@ -40,29 +40,29 @@ class Controller_home extends Crunchbutton_Controller_Account {
|
||||
|
||||
$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(),
|
||||
$chartRevenue->getGroups(),
|
||||
$chartChurn->getGroups(),
|
||||
$chartGift->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()->display('home/index');
|
||||
|
||||
@ -39,15 +39,29 @@ class Crunchbutton_Chart extends Cana_Model {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getGroups(){
|
||||
$groups = [];
|
||||
public function getGroups( $_group = false ){
|
||||
$groups = [];
|
||||
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 ][ 'title' ] = $group[ 'title' ];
|
||||
$charts = $group[ 'charts' ];
|
||||
if( count( $charts ) > 0 ){
|
||||
foreach ( $charts as $id_chart => $chart ) {
|
||||
$groups[ $id_group ][ 'url' ] = $id_chart;
|
||||
$groups[ $id_group ][ 'url' ] = $id_chart;
|
||||
}
|
||||
}
|
||||
if( !$groups[ $id_group ][ 'url' ] ){
|
||||
|
||||
@ -16,6 +16,7 @@ class Crunchbutton_Chart_Giftcard extends Crunchbutton_Chart {
|
||||
),
|
||||
'group-giftcards-redeemed' => array(
|
||||
'title' => 'Gift card Redeemed',
|
||||
'groups' => array( 'detailed-analytics' ),
|
||||
'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-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(
|
||||
'title' => 'Orders by Weekday by Community',
|
||||
'groups' => array( 'detailed-analytics' ),
|
||||
'charts' => array(
|
||||
'orders-by-weekday-by-community' => array( 'title' => '', 'type' => 'area', 'method' => 'byWeekdayByCommunity' )
|
||||
)
|
||||
),
|
||||
'group-orders-per-restaurant-by-community' => array(
|
||||
'title' => 'Orders per Restaurant by Community',
|
||||
'groups' => array( 'detailed-analytics' ),
|
||||
'charts' => array(
|
||||
'orders-per-restaurant-by-community' => array( 'title' => '', 'type' => 'pie_communities', 'method' => 'perRestaurantPerCommunity' )
|
||||
)
|
||||
),
|
||||
'group-orders-track-frequece' => array(
|
||||
'title' => 'Track Orders Frequency',
|
||||
'groups' => array( 'detailed-analytics' ),
|
||||
'charts' => array(
|
||||
'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 $groups = array(
|
||||
|
||||
'group-users-reclaimed' => array(
|
||||
'groups' => array( 'detailed-analytics' ),
|
||||
'title' => 'Reclaimed Users',
|
||||
'charts' => array(
|
||||
'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(
|
||||
'title' => 'Track User Frequency',
|
||||
'groups' => array( 'detailed-analytics' ),
|
||||
'charts' => array(
|
||||
'users-track-frequece' => array( 'title' => 'Users', 'interval' => 'week', 'type' => 'area', 'method' => 'trackFrequence' ),
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user