Browse Source

feat:修改售后模块字段显示

antshop
linyaostalker 5 years ago
parent
commit
16f0d16982
  1. 8
      backend/modules/shop/models/ars/AfterSale.php
  2. 10
      backend/modules/shop/models/searchs/AfterSaleSearch.php
  3. 14
      backend/modules/shop/views/after-sale/view.php

8
backend/modules/shop/models/ars/AfterSale.php

@ -58,6 +58,12 @@ class AfterSale extends \yii\db\ActiveRecord
self::REFUND_MODE_MONEY => '仅退款', self::REFUND_MODE_MONEY => '仅退款',
self::REFUND_MODE_MONEY_GOODS => '退货退款' self::REFUND_MODE_MONEY_GOODS => '退货退款'
]; ];
public static $afterSaleReason = [
1 => '7天无理由退货',
2 => '质量问题',
3 => '买错东西',
4 => '商品不满意',
];
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@ -89,7 +95,7 @@ class AfterSale extends \yii\db\ActiveRecord
'wx_refund_id' => '微信退款单号', 'wx_refund_id' => '微信退款单号',
'after_sale_sn' => '售后单号', 'after_sale_sn' => '售后单号',
'user_id' => '用户id', 'user_id' => '用户id',
'order_goods_id' => '订单商品id',
'order_goods_id' => '订单商品',
'amount' => '退货时实际退的金额', 'amount' => '退货时实际退的金额',
'count' => '退货的商品数量', 'count' => '退货的商品数量',
'apply_at' => '申请时间', 'apply_at' => '申请时间',

10
backend/modules/shop/models/searchs/AfterSaleSearch.php

@ -55,7 +55,6 @@ class AfterSaleSearch extends AfterSale
], ],
'id', 'id',
'after_sale_sn', 'after_sale_sn',
'operator_id',
[ [
'attribute' => 'order_goods_id', 'attribute' => 'order_goods_id',
'value' => function ($model) { 'value' => function ($model) {
@ -65,11 +64,16 @@ class AfterSaleSearch extends AfterSale
[ [
'attribute' => 'order_pay_amount', 'attribute' => 'order_pay_amount',
'value' => function ($model) { 'value' => function ($model) {
return $model->goods->order->payment_amount;
return sprintf("%1\$.2f", $model->goods->order->payment_amount);
}, },
'label' => '订单支付金额' 'label' => '订单支付金额'
], ],
'amount',
[
'attribute' => 'amount',
'value' => function ($model) {
return sprintf("%1\$.2f", $model->amount);
}
],
[ [
'attribute' => 'status', 'attribute' => 'status',
'value' => function ($model) { 'value' => function ($model) {

14
backend/modules/shop/views/after-sale/view.php

@ -63,7 +63,12 @@ $this->params['breadcrumbs'][] = $this->title;
return $model->goods->goods_name; return $model->goods->goods_name;
} }
], ],
'amount',
[
'attribute' => 'amount',
'value' => function ($model) {
return sprintf("%1\$.2f", $model->amount);
}
],
'count', 'count',
'apply_at:datetime', 'apply_at:datetime',
'dealt_at:datetime', 'dealt_at:datetime',
@ -83,7 +88,12 @@ $this->params['breadcrumbs'][] = $this->title;
return AfterSale::$status[$model->status]; return AfterSale::$status[$model->status];
} }
], ],
'reason',
[
'attribute' => 'reason',
'value' => function ($model) {
return $model->reason ? AfterSale::$afterSaleReason[$model->reason] : '未设置';
}
],
'remarks:ntext', 'remarks:ntext',
'take_shipping_sn', 'take_shipping_sn',
[ [

Loading…
Cancel
Save