rabin 1 ano atrás
pai
commit
2894603ee1
4 arquivos alterados com 25 adições e 3 exclusões
  1. 0 1
      database/yspay_cash.php
  2. 4 0
      yspay/Cash.php
  3. 19 0
      yspay/Merchant.php
  4. 2 2
      yspay/Multi.php

+ 0 - 1
database/yspay_cash.php

@@ -28,7 +28,6 @@ if ($merchant_id) {
             '账户提现' => array('fast', '', 'yspay_cash_tixian&search_option_merchant_id=' . $merchant_id),
         );
     }
-    
 }
 
 return array

+ 4 - 0
yspay/Cash.php

@@ -77,8 +77,11 @@ class Cash
 	    		$state = Dever::db('pay/yspay_cash')->update($update);
 	    		if ($state) {
 	    			if ($status == 2) {
+	    				$info = Dever::db('pay/yspay_cash')->find(array('id' => $info['id'], 'clear' => true));
+
 	    				$total = Dever::db('pay/yspay_cash')->getTotal(array('status' => 2, 'merchant_id' => $info['merchant_id']));
 	    				if ($total) {
+	    					Dever::load('pay/yspay/merchant')->log($info['merchant_id'], 1, $info['hf_cash']);
 	    					Dever::db('pay/yspay_merchant')->update(array('where_id' => $info['merchant_id'], 'cash' => $total['cash'], 'hf_cash' => $total['hf_cash'], 'fz_cash' => $total['fz_cash']));
 	    				}
 	    				$info = Dever::db('pay/yspay_cash')->find(array('id' => $info['id'], 'clear' => true));
@@ -257,6 +260,7 @@ class Cash
 		$status = $this->huafu_act($info);
 		if ($status == 1) {
 			Dever::db('pay/yspay_merchant')->updateTxCash(array('where_id' => $merchant_id, 'hf_tx_cash' => $cash));
+			Dever::load('pay/yspay/merchant')->log($merchant['merchant_id'], 3, $cash);
 		}
     }
 }

+ 19 - 0
yspay/Merchant.php

@@ -149,4 +149,23 @@ class Merchant
             return '暂无';
         }
     }
+
+    public function log($merchant_id, $type, $cash)
+    {
+        $merchant = Dever::db('pay/yspay_merchant')->one(array('id' => $merchant_id, 'clear' => true));
+        if ($merchant) {
+            $yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'];
+            if ($type == 3) {
+                $yue -= $cash;
+            } else {
+                $yue += $cash;
+            }
+            $data = array();
+            $data['merchant_id'] = $merchant_id;
+            $data['type'] = $type;
+            $data['cash'] = $cash;
+            $data['yue'] = $yue;
+            Dever::db('pay/yspay_merchant_log')->insert($data);
+        }
+    }
 }

+ 2 - 2
yspay/Multi.php

@@ -23,7 +23,7 @@ class Multi
     	$this->config = $config;
 
     	$mid = $merchant['mid'];
-    	$cash = $info['hf_cash'];
+    	$cash = $info['hf_cash']/10;
     	$order_num = $this->getOrderNum($info['order_num']);
 
     	//整理内容信息
@@ -61,7 +61,7 @@ class Multi
     	$this->config = $config;
 
     	$mid = $this->config['cash_mid'];
-    	$cash = $info['fz_cash'] + $info['pt_cash'];
+    	$cash = ($info['fz_cash'] + $info['pt_cash'])/10;
     	if (!$cash || $cash <= 0) {
     		return false;
     	}