rabin 1 년 전
부모
커밋
d8fb4d753e
4개의 변경된 파일9개의 추가작업 그리고 12개의 파일을 삭제
  1. 2 2
      database/yspay_merchant_log.php
  2. 4 4
      yspay/Cash.php
  3. 2 6
      yspay/Merchant.php
  4. 1 0
      yspay/Multi.php

+ 2 - 2
database/yspay_merchant_log.php

@@ -78,7 +78,7 @@ return array
             'desc'      => '交易金额',
             'match'     => 'option',
             'update'    => 'text',
-            'list'      => 'round({cash}/1000, 3)',
+            'list'      => 'Dever::number({cash}/1000, 2)',
         ),
 
         'yue'      => array
@@ -89,7 +89,7 @@ return array
             'desc'      => '交易后余额',
             'match'     => 'option',
             'update'    => 'text',
-            'list'      => 'round({yue}/1000, 3)',
+            'list'      => 'Dever::number({yue}/1000, 2)',
         ),
 
         'state'     => array

+ 4 - 4
yspay/Cash.php

@@ -241,7 +241,7 @@ class Cash
     	$cash = Dever::param('cash', $data);
     	$merchant = Dever::db('pay/yspay_merchant')->one($merchant_id);
     	if ($merchant) {
-    		$this->tixian_act();
+    		$this->tixian_act($merchant, $cash);
     	}
     	return false;
     }
@@ -254,13 +254,13 @@ class Cash
 			Dever::alert('余额不足');
 		}
 
-		$info['merchant_id'] = $merchant_id;
+		$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));
-			Dever::load('pay/yspay/merchant')->log($merchant['merchant_id'], 3, $cash);
+			Dever::db('pay/yspay_merchant')->updateTxCash(array('where_id' => $merchant['id'], 'hf_tx_cash' => $cash));
+			Dever::load('pay/yspay/merchant')->log($merchant['id'], $merchant['account_id'], 3, $cash);
 		}
     }
 }

+ 2 - 6
yspay/Merchant.php

@@ -150,17 +150,13 @@ class Merchant
         }
     }
 
-    public function log($merchant_id, $type, $cash)
+    public function log($merchant_id, $account_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['account_id'] = $account_id;
             $data['merchant_id'] = $merchant_id;
             $data['type'] = $type;
             $data['cash'] = $cash;

+ 1 - 0
yspay/Multi.php

@@ -35,6 +35,7 @@ class Multi
         ];
         Dever::log($content, 'yspay_huafu');
         $result = $this->curl('202002', $content);
+        //$result = 'ok';
         if ($result == 'ok') {
         	$data['status'] = 1;
         } else {