当前位置: 首页>>代码示例>>PHP>>正文


PHP Dashboard::get_chart_order方法代码示例

本文整理汇总了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);
 }
开发者ID:EdgeCommerce,项目名称:edgecommerce,代码行数:54,代码来源:admin.php


注:本文中的Dashboard::get_chart_order方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。