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


PHP Model_Users::getAll方法代码示例

本文整理汇总了PHP中Model_Users::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Users::getAll方法的具体用法?PHP Model_Users::getAll怎么用?PHP Model_Users::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model_Users的用法示例。


在下文中一共展示了Model_Users::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_index

 public function get_index($unused_param = 0)
 {
     $this->response->type(\Eliya\Mime::XML)->isRaw(true);
     $categories = Model_Categories::getAll();
     $categoriesIdsToNames = [];
     foreach ($categories as $category) {
         $categoriesIdsToNames[$category->getId()] = $category->prop('name');
     }
     $authors = Model_Users::getAll();
     $authorsIdsToNames = [];
     foreach ($authors as $author) {
         $authorsIdsToNames[$author->getId()] = $author->prop('username');
     }
     $tpl_items = null;
     $articles = Model_Articles::getLast(1, self::ARTICLES_BY_PAGE);
     foreach ($articles as $article) {
         $tpl_items .= \Eliya\Tpl::get('rss/item_article', ['article' => $article, 'author' => $authorsIdsToNames[$article->id_author] ?: null, 'category' => $categoriesIdsToNames[$article->id_category] ?: null]);
     }
     $this->response->set(\Eliya\Tpl::get('rss/index', ['tpl_items' => $tpl_items]));
 }
开发者ID:adrien-gueret,项目名称:le-chomp-enchaine,代码行数:20,代码来源:rss.php

示例2: indexAction

 public function indexAction()
 {
     $request = $this->getRequest();
     $this->view->base_url = $request->getBaseUrl();
     #LINKS FOR HEAD PARTS IN BOX
     $this->view->finance_href = $request->getModule() . '/reports/';
     $this->view->sales_href = $request->getModule() . '/orders/';
     $this->view->users_href = $request->getModule() . '/users/';
     $this->view->approval_href = $request->getModule() . '/queueitems/';
     $this->view->queue_href = $request->getModule() . '/queueupdateditems/';
     $this->view->contacts_href = $request->getModule() . '/contacts/';
     $this->view->gainpayingup_href = $request->getModule() . '/gainpayingup/';
     $this->view->tags_href = $request->getModule() . '/tags/?filter_visible=false';
     #LOAD ORDERS COUNT
     $this->view->total = Model_Orders::getSalesStatus();
     if ($this->view->total) {
         $this->view->total['total_f'] = WM_Currency::format($this->view->total['total']);
     }
     $ref = Model_Orders::getSalesStatus(" AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ", 'referal');
     $sales = Model_Orders::getSalesStatus(" AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ");
     if ($sales) {
         if ($ref) {
             $sales['referal'] = $ref['receive'];
         } else {
             $sales['referal'] = 0;
         }
         $sales['win'] = floatval($sales['total']) - floatval($sales['receive']) - floatval($sales['referal']);
         $sales['total_f'] = WM_Currency::format($sales['total']);
         $sales['receive_f'] = WM_Currency::format($sales['receive']);
         $sales['referal_f'] = WM_Currency::format($sales['referal']);
         $sales['win_f'] = WM_Currency::format($sales['win']);
     }
     $this->view->sales = $sales;
     unset($ref);
     $ref = Model_Orders::getSalesStatus("", 'referal');
     $sales = Model_Orders::getSalesStatus("");
     if ($sales) {
         if ($ref) {
             $sales['referal'] = $ref['receive'];
         } else {
             $sales['referal'] = 0;
         }
         $sales['win'] = floatval($sales['total']) - floatval($sales['receive']) - floatval($sales['referal']);
         $sales['total_f'] = WM_Currency::format($sales['total']);
         $sales['receive_f'] = WM_Currency::format($sales['receive']);
         $sales['referal_f'] = WM_Currency::format($sales['referal']);
         $sales['win_f'] = WM_Currency::format($sales['win']);
     }
     $this->view->sales2 = $sales;
     unset($ref);
     #LOAD USERS COUNT
     $this->view->users = array();
     $this->view->users['month'] = Model_Users::getUsersCount(" `register_datetime` > '" . date('Y-m') . "-01 00:00:00' AND `status` = 'activate' ");
     $this->view->users['total'] = Model_Users::getUsersCount(" `status` = 'activate' ");
     $this->view->topAuthors = array();
     $topAuthors = Model_Users::getAll(0, 5, " `status` = 'activate' ", "`sales` DESC");
     if ($topAuthors) {
         $percentsClass = new Model_Percents();
         foreach ($topAuthors as $user) {
             $user['deposit'] = WM_Currency::format($user['deposit']);
             $user['earning'] = WM_Currency::format($user['earning']);
             $user['total'] = WM_Currency::format($user['total']);
             $user['sold'] = WM_Currency::format($user['sold']);
             $user['referal_money'] = WM_Currency::format($user['referal_money']);
             $comision = $percentsClass->getPercentRow($user['user_id']);
             $user['commission'] = round($comision['percent']);
             $user['sum'] = Model_Balance::getTotalUserBalanceByType($user['user_id']);
             $user['web_profit'] = WM_Currency::format($user['web_profit']);
             $user['web_profit2'] = WM_Currency::format($user['web_profit2']);
             $user['has_referral_sum'] = $user['referral_sum'];
             $user['referral_sum'] = WM_Currency::format($user['referral_sum']);
             $user['edit_href'] = $request->getModule() . '/users/edite/?id=' . $user['user_id'];
             $user['balance_href'] = $request->getModule() . '/users/balance/?id=' . $user['user_id'];
             $this->view->topAuthors[] = $user;
         }
     }
     #LOAD WITHDRAW
     $this->view->withdraw = array();
     $this->view->withdraw['no'] = Model_Deposit::getWithdrawCount(" `paid` = 'false' AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ");
     if ($this->view->withdraw['no']) {
         $this->view->withdraw['no']['total_f'] = WM_Currency::format($this->view->withdraw['no']['total']);
     }
     $this->view->withdraw['paid'] = Model_Deposit::getWithdrawCount(" `paid` = 'true' AND `paid_datetime` > '" . date('Y-m') . "-01 00:00:00' ");
     if ($this->view->withdraw['paid']) {
         $this->view->withdraw['paid']['total_f'] = WM_Currency::format($this->view->withdraw['paid']['total']);
     }
     #LOAD THEMES
     $this->view->items = Model_Items::getItems(array('filter_status' => 'queue', 'start' => 0, 'limit' => 5));
     $this->view->updated_items = Model_Items::getItems(array('filter_update' => true, 'start' => 0, 'limit' => 5));
     #LOAD LAST REQUEST
     $this->view->contacts = array();
     $contacts = Model_Contacts::getContacts(array('filter_answer_datetime' => '0000-00-00', 'start' => 0, 'limit' => 5));
     if ($contacts) {
         foreach ($contacts as $contact) {
             $data = new JO_Date($contact['datetime'], 'dd MM yy');
             $contact['datetime'] = $data->toString();
             $contact['has_response'] = $contact['answer_datetime'] != '0000-00-00 00:00:00';
             if ($contact['answer_datetime'] != '0000-00-00 00:00:00') {
                 $data = new JO_Date($contact['answer_datetime'], 'dd MM yy');
                 $contact['answer_datetime'] = $data->toString();
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:PD,代码行数:101,代码来源:IndexController.php


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