xieruidong 2 years ago
parent
commit
dc470ea210

+ 1 - 1
application/api/controller/mall/OrderRefund.php

@@ -46,7 +46,7 @@ class OrderRefund extends Api
         ]);
         Db::startTrans();
         $refund=$user->refund()->lock(true)->findOrFail($data['refund_id']);
-        if(!$refund->is_goods_back){
+        if(!$refund->is_goods_back && $refund->refund_by){
             $this->error('操作失败');
         }
         $refund->user_trans_com_id=$data['user_trans_com_id'];

+ 6 - 0
application/common/model/Refund.php

@@ -23,6 +23,7 @@ use Yansongda\Supports\Arr;
  * @property int rm_time
  * @property int user_send_time
  * @property int user_trans_com_id
+ * @property int refund_by
  * @property string user_trans_no
  * @property bool is_wait_audit
  * @property bool has_money
@@ -31,6 +32,7 @@ use Yansongda\Supports\Arr;
  * @property bool need_tk
  * @property bool need_complete
  * @property bool can_view_logistics
+ * @property bool self_back_goods
  * @property string audit_remark
  * @property string order_no
  * @property string fix_order_no
@@ -456,6 +458,10 @@ class Refund Extends Model
     public function getIsGoodsBackAttr($_,$model){
         return $this->refund_status==self::REFUND_PASS && in_array($this->refund_type,self::getRefundTypeGoods());
     }
+    #是否自己寄回
+    public function getSelfBackGoodsAttr($_,$model){
+        return $this->refund_status==self::REFUND_PASS && $this->refund_type==self::TH_TYPE_SELF_SEND;
+    }
     public function getRefundStatusTextAttr($_,$model){
         return Arr::get(self::getRefundStatus(),$model['refund_status']);
     }