當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。