dever 5 years ago
parent
commit
c7293a59c5
1 changed files with 8 additions and 4 deletions
  1. 8 4
      lib/Set.php

+ 8 - 4
lib/Set.php

@@ -31,10 +31,14 @@ class Set
         $order = Dever::db('pay/order')->one(array('order_id' => $order_id, 'uid' => $uid));
 
         if ($order) {
-            $pay = Dever::db('pay/account')->one($order['account_id']);
-            $method = '\\Pay\\Lib\\' . ucwords($pay['type']);
-            $method = new $method($pay);
-            $method->refund($order_id);
+
+            if ($status == 5) {
+                $pay = Dever::db('pay/account')->one($order['account_id']);
+                $method = '\\Pay\\Lib\\' . ucwords($pay['type']);
+                $method = new $method($pay);
+                $method->refund($order_id);
+            }
+            
 
         	$update['where_id'] = $order['id'];
         	$update['status'] = $status;