当前位置: 首页>>代码示例>>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;未经允许,请勿转载。