當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Order::count方法代碼示例

本文整理匯總了PHP中common\models\Order::count方法的典型用法代碼示例。如果您正苦於以下問題:PHP Order::count方法的具體用法?PHP Order::count怎麽用?PHP Order::count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在common\models\Order的用法示例。


在下文中一共展示了Order::count方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ActiveDataProvider

               <!-- Messages: style can be found in dropdown.less-->
                <?php 
if (Order::count() > 0) {
    ?>
                <li class="dropdown messages-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-envelope-o"></i>
                        <span class="label label-success"><?php 
    echo Order::count();
    ?>
</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="header">У вас <?php 
    echo Order::count();
    ?>
 заявок</li>
                        <li>
                            <!-- inner menu: contains the actual data -->
                            <ul class="menu">
                               <?php 
    echo ListView::widget(['dataProvider' => $provider = new ActiveDataProvider(['query' => Order::find()->where(['is_new' => 0]), 'sort' => ['defaultOrder' => ['is_new' => SORT_ASC, 'id' => SORT_DESC]]]), 'itemOptions' => ['class' => 'item'], 'itemView' => function ($model, $key, $index, $widget) {
        return $this->render('_order', ['model' => $model]);
    }, 'layout' => "{items}"]);
    ?>
                            </ul>
                        </li>
                        <li class="footer"><a href="#">Все сообщения</a></li>
                    </ul>
                </li>
開發者ID:uraankhayayaal,項目名稱:aic.s-vfu.ru,代碼行數:30,代碼來源:header.php

示例2:

        </div>

        <!-- search form 
        <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Поиск..."/>
              <span class="input-group-btn">
                <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
            </div>
        </form>
        /.search form -->
        <?php 
if (Order::count() > 0) {
    $order = ' (' . Order::count() . ')';
} else {
    $order = '';
}
?>
        <?php 
echo Nav::widget(['encodeLabels' => false, 'options' => ['class' => 'sidebar-menu'], 'items' => ['<li class="header">Меню администрации</li>', ['label' => '<span>Системные настройки</span>', 'url' => ['/setting/index']], ['label' => '<span>Новости</span>', 'url' => ['/article/index'], 'items' => [['label' => '<span>Создать новость</span>', 'url' => ['/article/create']], ['label' => '<span>Все новости</span>', 'url' => ['/article/index']]]], ['label' => '<span>Мероприятия</span>', 'url' => ['/event/index'], 'items' => [['label' => '<span>Создать мероприятие</span>', 'url' => ['/event/create']], ['label' => '<span>Все мероприятия</span>', 'url' => ['/event/index']]]], ['label' => '<span>МИП</span>', 'url' => ['/mip/index'], 'items' => [['label' => '<span>Создать МИП</span>', 'url' => ['/mip/create']], ['label' => '<span>Все МИП-ы</span>', 'url' => ['/mip/index']]]], ['label' => '<span>Лаборатории</span>', 'url' => ['/lab/index'], 'items' => [['label' => '<span>Создать Лабораторию</span>', 'url' => ['/lab/create']], ['label' => '<span>Все Лаборатории</span>', 'url' => ['/lab/index']]]], ['label' => '<span>Разделы МИП-ов</span>', 'url' => ['/section/index'], 'items' => [['label' => '<span>Создать раздел</span>', 'url' => ['/section/create']], ['label' => '<span>Все разделы</span>', 'url' => ['/section/index']]]], ['label' => '<span>Заявки' . $order . '</span>', 'url' => ['/order/index']]]]);
?>

        <!--<ul class="sidebar-menu">
            <li class="treeview">
                <a href="#">
                    <span>Страницы</span><i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php 
開發者ID:uraankhayayaal,項目名稱:aic.s-vfu.ru,代碼行數:31,代碼來源:left.php


注:本文中的common\models\Order::count方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。