Browse Source

退款方式给前端

lizhen_gitee 2 tháng trước cách đây
mục cha
commit
9f1692935d
1 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 16 0
      application/admin/model/shopro/order/Aftersale.php

+ 16 - 0
application/admin/model/shopro/order/Aftersale.php

@@ -26,6 +26,7 @@ class Aftersale extends Common
 
         //物流状态
         'express_status_text',
+        'refund_type_text',
     ];
 
     public function expressStatusList()
@@ -44,6 +45,13 @@ class Aftersale extends Common
             'back' => '退回',
         ];
     }
+    public function refundTypeList()
+    {
+        return [
+            'back'  => '原路返回',
+            'money' => '余额',
+        ];
+    }
 
     // 发货状态
     const DISPATCH_STATUS_REFUSE = -1;       // 拒收
@@ -274,6 +282,14 @@ class Aftersale extends Common
         return isset($list[$value]) ? $list[$value] : '';
     }
 
+    public function getRefundTypeTextAttr($value, $data)
+    {
+        $value = $value ?: ($data['refund_type'] ?? null);
+
+        $list = $this->refundTypeList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
 
     /**
      * 获取建议退款金额,不考虑剩余可退款金额是否够退