rabin il y a 2 ans
Parent
commit
fa91f226c0
1 fichiers modifiés avec 18 ajouts et 13 suppressions
  1. 18 13
      yspay/Cash.php

+ 18 - 13
yspay/Cash.php

@@ -237,20 +237,25 @@ class Cash
     	$cash = Dever::param('cash', $data);
     	$merchant = Dever::db('pay/yspay_merchant')->one($merchant_id);
     	if ($merchant) {
-    		$cash = $cash*$this->num;
-    		$yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'] - $this->num*$this->bfj;
-    		if ($yue < $cash) {
-    			Dever::alert('余额不足');
-    		}
-
-    		$info['merchant_id'] = $merchant_id;
-    		$info['hf_cash'] = $cash;
-    		$info['order_num'] = Dever::order('TX');
-    		$status = $this->huafu_act($info);
-    		if ($status == 1) {
-    			Dever::db('pay/yspay_merchant')->updateTxCash(array('where_id' => $merchant_id, 'hf_tx_cash' => $cash));
-    		}
+    		$this->tixian_act();
     	}
     	return false;
     }
+
+    public function tixian_act($merchant, $cash)
+    {
+    	$cash = $cash*$this->num;
+		$yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'] - $this->num*$this->bfj;
+		if ($yue < $cash) {
+			Dever::alert('余额不足');
+		}
+
+		$info['merchant_id'] = $merchant_id;
+		$info['hf_cash'] = $cash;
+		$info['order_num'] = Dever::order('TX');
+		$status = $this->huafu_act($info);
+		if ($status == 1) {
+			Dever::db('pay/yspay_merchant')->updateTxCash(array('where_id' => $merchant_id, 'hf_tx_cash' => $cash));
+		}
+    }
 }