本文整理汇总了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>
示例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