本文整理汇总了PHP中Dashboard::get_chart_order方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::get_chart_order方法的具体用法?PHP Dashboard::get_chart_order怎么用?PHP Dashboard::get_chart_order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dashboard
的用法示例。
在下文中一共展示了Dashboard::get_chart_order方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_dashboard
/**
* Admin dashboard view
*
* @access public
* @return void
*/
public function action_dashboard($type = 'm')
{
$orders = \Dashboard::get_order($type);
$visitors = \Dashboard::get_visits($type);
$c_orders = \Dashboard::get_chart_order($type);
$co_html = '';
foreach ($c_orders as $order) {
$co_html .= '[' . (int) $order['MNTH'] . ', ' . (double) $order['total_price'] . ']';
$co_html .= ',';
}
$c_visits = \Dashboard::get_chart_visits();
$visits_html = '';
foreach ($c_visits as $order) {
$visits_html .= '[' . (int) $order['MNTH'] . ', ' . (double) $order['visits'] . ']';
$visits_html .= ',';
}
if ($type == 'd') {
$type = 'Today';
} elseif ($type == 'm') {
$type = 'This Month';
} elseif ($type == 'y') {
$type = 'This Year';
} else {
$type = 'This Week';
}
$users = \Sentry::user()->all('front');
// if(!empty($users))
// {
// foreach($users as $key => $item)
// {
// $user_tmp = \Sentry::user((int)$item['id']);
// if($user_tmp->get('metadata.guest') == 1)
// unset($users[$key]);
// else
// $users[$key] = $user_tmp;
// }
// }
$items['orders'] = $orders[0]['total_order'];
$items['sales'] = $orders[0]['total_sales'];
$items['visits'] = $visitors[0]['visits'];
$items['users'] = count($users);
$items['chart_orders'] = $co_html;
$items['chart_visits'] = $visits_html;
$items['type'] = $type;
//\View::set_global('full_page', true);
\View::set_global('title', 'Dashboard');
\Theme::instance()->set_partial('content', $this->view_dir . 'dashboard')->set('items', $items);
}