xieruidong %!s(int64=2) %!d(string=hai) anos
pai
achega
48582d78f0
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      application/common/model/Refund.php

+ 4 - 1
application/common/model/Refund.php

@@ -108,6 +108,9 @@ class Refund Extends Model
         $this['pay_remark']=$remark;
         $this->save();
     }
+    public function isRefundMoney(){
+        return in_array($this['refund_type'],self::getRefundTypeMoney());
+    }
     #end
     public function makeAudit($pass){
         $this['refund_status']=$pass?self::REFUND_PASS:self::REFUND_REJECT;
@@ -166,7 +169,7 @@ class Refund Extends Model
             $refund['refund_status']=self::REFUND_ING;
         });
         self::afterUpdate(function (self $refund){
-            if($refund->refund_status==self::REFUND_PASS){
+            if($refund->refund_status==self::REFUND_PASS && $refund->isRefundMoney()){
                 Transaction::addTransaction($refund);
             }
         });