/**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $activeDataProvider) {
         $activeDataProvider->query->andWhere(['type' => ShopDiscount::TYPE_DEFAULT]);
     }, "gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['id', ['attribute' => 'name'], ['attribute' => 'value', 'class' => DataColumn::className(), 'value' => function (ShopDiscount $shopDiscount) {
         if ($shopDiscount->value_type == ShopDiscount::VALUE_TYPE_P) {
             return \Yii::$app->formatter->asPercent($shopDiscount->value / 100);
         } else {
             $money = Money::fromString((string) $shopDiscount->value, $shopDiscount->currency_code);
             return \Yii::$app->money->intlFormatter()->format($money);
         }
     }], ['attribute' => 'active', 'class' => BooleanColumn::className()], ['attribute' => 'active_from', 'class' => DateTimeColumnData::className()], ['attribute' => 'active_to', 'class' => DateTimeColumnData::className()], ['class' => UpdatedByColumn::className()], ['class' => UpdatedAtColumn::className()], 'priority']]]);
 }
Esempio n. 2
0
<?php

/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\Game */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewHasSettings::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => \skeeks\cms\modules\admin\grid\ActionColumn::className(), 'controller' => $controller], 'groupname', 'description', ['class' => \skeeks\cms\grid\CreatedAtColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], ['class' => \skeeks\cms\grid\CreatedByColumn::className()], ['class' => \skeeks\cms\grid\UpdatedByColumn::className()]]]);
Esempio n. 3
0
/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$dataProvider->query->andWhere(['type' => \skeeks\cms\shop\models\ShopDiscount::TYPE_DEFAULT]);
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['id', ['attribute' => 'name'], ['attribute' => 'value', 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\shop\models\ShopDiscount $shopDiscount) {
    if ($shopDiscount->value_type == \skeeks\cms\shop\models\ShopDiscount::VALUE_TYPE_P) {
        return \Yii::$app->formatter->asPercent($shopDiscount->value / 100);
    } else {
        $money = \skeeks\modules\cms\money\Money::fromString((string) $shopDiscount->value, $shopDiscount->currency_code);
        return \Yii::$app->money->intlFormatter()->format($money);
    }
}], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['attribute' => 'active_from', 'class' => \skeeks\cms\grid\DateTimeColumnData::className()], ['attribute' => 'active_to', 'class' => \skeeks\cms\grid\DateTimeColumnData::className()], ['class' => \skeeks\cms\grid\UpdatedByColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], 'priority']]);
?>

<? $pjax::end(); ?>
Esempio n. 4
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$dataProvider->query->andWhere(['type' => \skeeks\cms\shop\models\ShopDiscount::TYPE_DISCOUNT_SAVE]);
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['id', ['attribute' => 'name', 'label' => \Yii::t('skeeks/shop/app', 'Name of the program')], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['class' => \skeeks\cms\grid\UpdatedByColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], 'priority']]);
?>

<? $pjax::end(); ?>
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $activeDataProvider) {
         $activeDataProvider->query->andWhere(['type' => ShopDiscount::TYPE_DISCOUNT_SAVE]);
     }, "gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['id', ['attribute' => 'name', 'label' => \skeeks\cms\shop\Module::t('app', 'Name of the program')], ['attribute' => 'active', 'class' => BooleanColumn::className()], ['class' => UpdatedByColumn::className()], ['class' => UpdatedAtColumn::className()], 'priority']]]);
 }
Esempio n. 6
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['id', 'priority', 'name', ['attribute' => 'active', 'class' => BooleanColumn::className()], 'address', 'phone', 'description', ['class' => UpdatedAtColumn::className()], ['class' => UpdatedByColumn::className()], ['attribute' => 'site_code', 'class' => SiteColumn::className()]]]]);
 }