예제 #1
0
파일: Ecommerce.php 프로젝트: krvd/cms-Inji
 /**
  * Return count of items with params
  * 
  * @param array $params
  * @return int
  */
 public function getItemsCount($params = [])
 {
     $selectOptions = $this->parseOptions($params);
     $selectOptions['distinct'] = \Ecommerce\Item::index();
     $counts = Ecommerce\Item::getCount($selectOptions);
     if (is_array($counts)) {
         $sum = 0;
         foreach ($counts as $count) {
             $sum += $count['count'];
         }
         return $sum;
     }
     return $counts;
 }
예제 #2
0
return ['widget' => function () {
    ?>
        <div class="panel panel-default">
          <div class="panel-heading">Онлайн-магазин</div>
          <div class="panel-body">
            <div class="row">
              <div class="col-lg-6">
                <p>Всего товаров/отображаемых: <?php 
    echo Ecommerce\Item::getCount();
    ?>
 / <?php 
    echo \App::$cur->ecommerce->getItemsCount();
    ?>
</p>
                <p>Новых товаров/отображаемых сегодня: <?php 
    echo Ecommerce\Item::getCount(['where' => ['date_create', date('Y-m-d 00:00:00'), '>']]);
    ?>
 / <?php 
    echo \App::$cur->ecommerce->getItemsCount(['where' => ['date_create', date('Y-m-d 00:00:00'), '>']]);
    ?>
</p>
              </div>
              <div class="col-lg-6">
                <p>Всего Корзин/Заказов: <?php 
    echo Ecommerce\Cart::getCount();
    ?>
 / <?php 
    echo Ecommerce\Cart::getCount(['where' => ['cart_status_id', 1, '>']]);
    ?>
</p>
                <p>Новых Корзин/Заказов сегодня:  <?php