Browse Source

feat: 优化订单列表

wechat_public_accounts
travis 5 years ago
parent
commit
13db38ab4a
  1. 70
      backend/modules/shop/models/searchs/OrderSearch.php
  2. 19
      backend/modules/shop/views/order/order_info.php
  3. 39
      backend/modules/shop/views/order/pay_info.php
  4. 23
      backend/modules/shop/views/order/shipping_info.php
  5. 22
      backend/modules/shop/views/order/table_consignee_info.php

70
backend/modules/shop/models/searchs/OrderSearch.php

@ -53,21 +53,47 @@ class OrderSearch extends Order
'width' => '2%',
'align' => 'center'
],
'id',
[
'attribute' => 'id',
'width' => '5%',
],
[
'attribute' => 'user_id',
'width' => '7%',
// 'value' => function ($model) {
// return base64_decode($model->user->nickname);
// }
],
'order_sn',
'invoice_id',
'status',
'type',
'goods_count',
'goods_amount',
'shipping_amount',
'shipping_type',
[
'attribute' => 'order_sn',
'width' => '8%',
],
[
'attribute' => 'invoice_id',
'width' => '8%',
],
[
'attribute' => 'status',
'width' => '5%',
],
[
'attribute' => 'type',
'width' => '5%',
],
[
'label' => '订单信息',
'format' => 'raw',
'value' => function ($model) {
return Yii::$app->controller->renderPartial('order_info', ['model' => $model]);
},
],
[
'label' => '物流信息',
'format' => 'raw',
'value' => function ($model) {
return Yii::$app->controller->renderPartial('shipping_info', ['model' => $model]);
},
],
[
'label' => '收货信息',
'format' => 'raw',
@ -75,27 +101,23 @@ class OrderSearch extends Order
return Yii::$app->controller->renderPartial('table_consignee_info', ['model' => $model]);
},
],
'taking_site',
'pay_type',
'pay_at',
'payment_sn',
'payment_amount',
'receivables',
'remarks',
'discount_amount',
'discount_description',
[
'attribute' => 'updated_at',
'value' => function ($model) {
return date('Y-m-d H:i:s', $model->updated_at);
}
'attribute' => 'remarks',
'width' => '8%',
],
[
'attribute' => 'created_at',
'attribute' => 'updated_at',
'width' => '8%',
'value' => function ($model) {
return date('Y-m-d H:i:s', $model->created_at);
return date('Y-m-d H:i:s', $model->updated_at);
}
],
// [
// 'attribute' => 'created_at',
// 'value' => function ($model) {
// return date('Y-m-d H:i:s', $model->created_at);
// }
// ],
[
'class' => 'iron\grid\ActionColumn',
'align' => 'center',

19
backend/modules/shop/views/order/order_info.php

@ -0,0 +1,19 @@
<style>
.info td:nth-child(1) {
white-space: nowrap;
}
p {
margin: 1px;
}
</style>
<table class="info">
<tr>
<td>商品数量:</td>
<td><?= $model->goods_count ?></td>
</tr>
<tr>
<td>商品金额:</td>
<td><?= $model->goods_amount ?></td>
</tr>
</table>

39
backend/modules/shop/views/order/pay_info.php

@ -0,0 +1,39 @@
<style>
.info td:nth-child(1) {
white-space: nowrap;
}
p {
margin: 1px;
}
</style>
<table class="info">
<tr>
<td></td>
<td><?= $model->pay_type ?></td>
</tr>
<tr>
<td></td>
<td><?= $model->pay_at ?></td>
</tr>
<tr>
<td></td>
<td><?= $model->payment_sn ?></td>
</tr>
<tr>
<td></td>
<td><?= $model->payment_amount ?></td>
</tr>
<tr>
<td></td>
<td><?= $model->receivables ?></td>
</tr>
<tr>
<td></td>
<td><?= $model->discount_amount ?></td>
</tr>
<tr>
<td></td>
<td><?= $model->discount_description ?></td>
</tr>
</table>

23
backend/modules/shop/views/order/shipping_info.php

@ -0,0 +1,23 @@
<style>
.info td:nth-child(1) {
white-space: nowrap;
}
p {
margin: 1px;
}
</style>
<table class="info">
<tr>
<td>物流类型:</td>
<td><?= $model->shipping_type ?></td>
</tr>
<tr>
<td>商品金额:</td>
<td><?= $model->goods_amount ?></td>
</tr>
<tr>
<td>自提点:</td>
<td><?= $model->taking_site ?></td>
</tr>
</table>

22
backend/modules/shop/views/order/table_consignee_info.php

@ -1,19 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: iron
* Date: 2018/7/5
* Time: 16:21
*/
?>
<style>
.info td:nth-child(1) {
/*padding-right: 5px;*/
white-space: nowrap;
}
p {
margin: 1px;
}
@ -21,15 +9,11 @@
<table class="info">
<tr>
<td><b>联系人:</b></td>
<td>联系人:</td>
<td><?= $model->consignee ?></td>
</tr>
<tr>
<td><b>地址:</b></td>
<td><p>
<?= ($model->provinceId ? $model->provinceId->name : '') . ($model->cityId ? $model->cityId->name : '') . ($model->area ? $model->area->name : '') ?>
</p>
<p><?= $model->address ?></p>
</td>
<td>地址:</td>
<td><?= $model->shipping_amount ?></td>
</tr>
</table>
Loading…
Cancel
Save