Example #1
0
	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
		<?php 
echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('backend', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
	</p>

	<?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['order_sn', ['attribute' => 'user_id', 'value' => $model->user->username], 'created_at:datetime', 'updated_at:datetime', 'phone', 'address:ntext', 'email:email', 'notes:ntext', ['attribute' => 'status', 'value' => ArrayHelper::getValue(ShopOrder::getStatus(), $model->status)]]]);
?>

	<div class="col-lg-12">
		<h4>该订单包含商品信息:</h4>
		<?php 
$orderItems = \common\models\ShopOrderItem::find()->where(['order_id' => $model->id])->all();
?>
		<?php 
foreach ($orderItems as $k => $v) {
    ?>
			<?php 
    echo DetailView::widget(['model' => $v, 'attributes' => ['title', 'price', 'product_id', 'quantity']]);
    ?>
		<?php 
}
?>
	</div>

</div>