Commit 459d6a6e by semenov

Начало разработки

parent 05875b7c
......@@ -92,9 +92,9 @@ class ShopOrder extends Core
'created_at' => Yii::t('app', 'Created At'),
'updated_at' => Yii::t('app', 'Updated At'),
'person_type_id' => Yii::t('app', 'Person Type ID'),
'payed' => Yii::t('app', 'Payed'),
'payed' => Yii::t('app', 'Оплачен'),
'payed_at' => Yii::t('app', 'Payed At'),
'canceled' => Yii::t('app', 'Canceled'),
'canceled' => Yii::t('app', 'Отменен'),
'canceled_at' => Yii::t('app', 'Canceled At'),
'reason_canceled' => Yii::t('app', 'Reason Canceled'),
'status' => Yii::t('app', 'Status'),
......
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 14.04.2015
*/
/* @var $widget \skeeks\modules\cms\shop\widgets\order\OrderWidget */
/* @var $model \skeeks\modules\cms\shop\models\ShopOrder */
/* @var $this \yii\web\View */
?>
<table class="table table-striped table-bordered">
<tr>
<th colspan="2">Заказ №<?= $model->id; ?> от <?= \Yii::$app->formatter->asDatetime($model->created_at); ?> (<?= \Yii::$app->formatter->asRelativeTime($model->created_at); ?>)</th>
</tr>
<tr>
<td width="40%">Текущий статус заказа:</td>
<td><?= $model->id; ?></td>
</tr>
<tr>
<td>Сумма заказа:</td>
<td><?= \Yii::$app->money->intlFormatter()->format($model->price()); ?></td>
</tr>
<tr>
<td>Отменен:</td>
<td></td>
</tr>
</table>
<table class="table table-striped table-bordered">
<tr>
<th colspan="2">Данные учетной записи</th>
</tr>
<tr>
<td width="40%">Учетная запись:</td>
<td><?= $model->user->getDisplayName(); ?></td>
</tr>
<tr>
<td>Логин:</td>
<td><?= $model->user->username; ?></td>
</tr>
<tr>
<td>E-Mail адрес:</td>
<td><?= $model->user->email; ?></td>
</tr>
</table>
<table class="table table-striped table-bordered">
<tr>
<th colspan="2">Параметры заказа</th>
</tr>
<tr>
<td width="40%">Тип плательщика:</td>
<td><?= $model->personType->name; ?></td>
</tr>
</table>
<table class="table table-striped table-bordered">
<tr>
<th colspan="2">Оплата и доставка</th>
</tr>
<tr>
<td width="40%">Платежная система:</td>
<td><?= $model->pay_system_id; ?></td>
</tr>
<tr>
<td>Оплачен:</td>
<td><?= $model->user->username; ?></td>
</tr>
</table>
<table class="table table-striped table-bordered">
<tr>
<th colspan="2">Служба доставки</th>
</tr>
<tr>
<td width="40%">Служба доставки:</td>
<td>Не установлена</td>
</tr>
</table>
<table class="table table-striped table-bordered">
<tr>
<th colspan="2">Содержимое заказа</th>
</tr>
<tr>
<td>
<?
$this->registerCss(<<<CSS
.sx-basket-table table img.img-thumbnail
{
max-width: 110px;
}
CSS
);
?>
<div class="sx-basket-table">
<?=
\skeeks\cms\modules\admin\widgets\GridView::widget([
"dataProvider" => new \yii\data\ArrayDataProvider([
'allModels' => \skeeks\modules\cms\shop\models\ShopBasket::find()->where(['order_id' => $model->id])->all()
]),
'layout' => '{items}',
'columns' =>
[
[
'class' => \yii\grid\DataColumn::className(),
'value' => function(\skeeks\modules\cms\shop\models\ShopBasket $model)
{
$product = $model->product();
$pageUrl = $product->getPageUrl();
$name = $product->name;
$imageUrl = skeeks\cms\helpers\Image::getSrc($product->getMainImageSrc());
return <<<HTML
<a href="{$pageUrl}" style="text-align: center;">
<img src="{$imageUrl}" alt="{$name}" title="{$name}" class="img-thumbnail">
</a>
HTML;
},
'format' => 'html',
'label' => 'Фото'
],
[
'class' => \yii\grid\DataColumn::className(),
'value' => function(\skeeks\modules\cms\shop\models\ShopBasket $model)
{
return \yii\helpers\Html::a($model->name, $model->product()->getPageUrl());
},
'format' => 'html',
'label' => 'Товар'
],
[
'class' => \yii\grid\DataColumn::className(),
'value' => function(\skeeks\modules\cms\shop\models\ShopBasket $model)
{
return $model->quantity;
},
'format' => 'raw',
'label' => 'Количество'
],
[
'class' => \yii\grid\DataColumn::className(),
'value' => function(\skeeks\modules\cms\shop\models\ShopBasket $model)
{
return \Yii::$app->money->intlFormatter()->format($model->product()->cost());
},
'format' => 'html',
'label' => 'Цена товара'
],
[
'class' => \yii\grid\DataColumn::className(),
'value' => function(\skeeks\modules\cms\shop\models\ShopBasket $model)
{
return \Yii::$app->money->intlFormatter()->format($model->price());
},
'format' => 'html',
'label' => 'Всего'
],
]
]);
?>
</div>
</td>
</tr>
</table>
\ No newline at end of file
......@@ -81,5 +81,15 @@ $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
return \Yii::$app->money->intlFormatter()->format($model->price());
},
],
[
'class' => \skeeks\cms\grid\BooleanColumn::className(),
'attribute' => 'payed',
],
[
'class' => \skeeks\cms\grid\BooleanColumn::className(),
'attribute' => 'canceled',
],
],
]); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment