rabin 1 년 전
부모
커밋
c4f658c176
5개의 변경된 파일32개의 추가작업 그리고 42개의 파일을 삭제
  1. 7 7
      database/yspay_cash.php
  2. 1 1
      database/yspay_cash_log.php
  3. 6 6
      database/yspay_merchant.php
  4. 15 26
      yspay/Cash.php
  5. 3 2
      yspay/Tixian.php

+ 7 - 7
database/yspay_cash.php

@@ -22,7 +22,7 @@ $info = '';
 if ($merchant_id) {
     $merchant = Dever::db('pay/yspay_merchant')->one($merchant_id);
     $yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'];
-    $yue = $yue/100;
+    $yue = $yue/1000;
     $beifujin = 0;
     if ($yue >= 100) {
         $beifujin = 100;
@@ -120,7 +120,7 @@ return array
             'default'   => '0',
             'desc'      => '交易金额',
             'match'     => 'option',
-            'list'      => 'Dever::number({ycash}/100, 2)',
+            'list'      => 'Dever::number({ycash}/1000, 2)',
         ),
 
         'yl_cash'      => array
@@ -130,7 +130,7 @@ return array
             'default'   => '0',
             'desc'      => '银联手续费',
             'match'     => 'option',
-            'list'      => 'Dever::number({yl_cash}/100, 2)',
+            'list'      => 'Dever::number({yl_cash}/1000, 2)',
         ),
 
         'pt_cash'      => array
@@ -140,7 +140,7 @@ return array
             'default'   => '0',
             'desc'      => '平台手续费',
             'match'     => 'option',
-            'list'      => 'Dever::number({pt_cash}/100, 2)',
+            'list'      => 'Dever::number({pt_cash}/1000, 2)',
         ),
 
         'cash'      => array
@@ -150,7 +150,7 @@ return array
             'default'   => '0',
             'desc'      => '实际金额',
             'match'     => 'option',
-            'list'      => 'Dever::number({cash}/100, 2)',
+            'list'      => 'Dever::number({cash}/1000, 2)',
         ),
 
         'hf_cash'      => array
@@ -161,7 +161,7 @@ return array
             'desc'      => '划付金额',
             'match'     => 'option',
             //'update'    => 'text',
-            'list'		=> 'Dever::number({hf_cash}/100, 2)',
+            'list'		=> 'Dever::number({hf_cash}/1000, 2)',
         ),
 
         'fz_cash'      => array
@@ -172,7 +172,7 @@ return array
             'desc'      => '分账金额',
             'match'     => 'option',
             //'update'    => 'text',
-            'list'		=> 'Dever::number({fz_cash}/100, 2)',
+            'list'		=> 'Dever::number({fz_cash}/1000, 2)',
         ),
 
         'fdate'     => array

+ 1 - 1
database/yspay_cash_log.php

@@ -96,7 +96,7 @@ return array
             'desc'      => '提现金额',
             'match'     => 'option',
             'update'    => 'text',
-            'list'      => 'round({cash}/100, 2)',
+            'list'      => 'round({cash}/1000, 2)',
         ),
 
         'tdate'     => array

+ 6 - 6
database/yspay_merchant.php

@@ -171,7 +171,7 @@ return array
             'match'     => 'option',
             //'update'    => 'text',
             'list_name' => '分账总额 / 划付总额 / 提现总额',
-            'list'      => $yspay_type == 1 ? false : 'Dever::number({fz_cash}/100, 2) . " / " . Dever::number({hf_cash}/100, 2) . " / " . Dever::number({hf_tx_cash}/100, 2)',
+            'list'      => $yspay_type == 1 ? false : 'Dever::number({fz_cash}/1000, 2) . " / " . Dever::number({hf_cash}/1000, 2) . " / " . Dever::number({hf_tx_cash}/1000, 2)',
         ),
 
         'hf_cash'      => array
@@ -182,7 +182,7 @@ return array
             'desc'      => '划付总额',
             'match'     => 'option',
             //'update'    => 'text',
-            //'list'		=> 'Dever::number({hf_cash}/100, 2)',
+            //'list'		=> 'Dever::number({hf_cash}/1000, 2)',
         ),
 
         'hf_tx_cash'      => array
@@ -193,7 +193,7 @@ return array
             'desc'      => '划付提现总额',
             'match'     => 'option',
             //'update'    => 'text',
-            //'list'        => 'Dever::number({hf_cash}/100, 2)',
+            //'list'        => 'Dever::number({hf_cash}/1000, 2)',
         ),
 
         'fz_cash'      => array
@@ -204,7 +204,7 @@ return array
             'desc'      => '分账总额',
             'match'     => 'option',
             //'update'    => 'text',
-            //'list'		=> 'Dever::number({fz_cash}/100, 2)',
+            //'list'		=> 'Dever::number({fz_cash}/1000, 2)',
         ),
 
         'yue'      => array
@@ -216,7 +216,7 @@ return array
             'match'     => 'option',
             //'update'    => 'text',
             'list_name' => '账户余额 / 提现总额',
-            'list'		=> $yspay_type == 2 ? false : 'Dever::number({yue}/100, 2) . " / " . Dever::number({tx_cash}/100, 2)',
+            'list'		=> $yspay_type == 2 ? false : 'Dever::number({yue}/1000, 2) . " / " . Dever::number({tx_cash}/1000, 2)',
         ),
 
         'tx_cash'      => array
@@ -227,7 +227,7 @@ return array
             'desc'      => '划付总额',
             'match'     => 'option',
             //'update'    => 'text',
-            //'list'		=> 'Dever::number({tx_cash}/100, 2)',
+            //'list'		=> 'Dever::number({tx_cash}/1000, 2)',
         ),
 
         'pay/yspay_sign-one#step'=> array

+ 15 - 26
yspay/Cash.php

@@ -3,6 +3,8 @@ use Dever;
 
 class Cash
 {
+	# 千分制
+	private $num = 1000;
 	# 入账:待确认
     public function add($merchant_id, $amount, $order_num, $source_order_num, $fenzhang = 0)
     {
@@ -35,7 +37,7 @@ class Cash
     public function up($id, $status = 2, $amount = false, $fenzhang = 0)
     {
     	if ($amount) {
-    		$amount = $amount * 100;
+    		$amount = $amount * $this->num;
     	}
     	if (is_numeric($id)) {
     		$where['id'] = $id;
@@ -99,14 +101,14 @@ class Cash
 	    		if (!$cash_per || $cash_per <= 0) {
 	    			$cash_per = 0;
 	    		} else {
-	    			$cash_per = $cash_per/100;
+	    			$cash_per = $cash_per/$this->num;
 	    		}
 			}
 			
-    		$per = $yspay['per']/100;
-    		$cash_jy_per = $yspay['cash_jy_per']/100;
+    		$per = $yspay['per']/$this->num;
+    		$cash_jy_per = $yspay['cash_jy_per']/$this->num;
 
-        	$data['ycash'] = $amount/100;
+        	$data['ycash'] = $amount/$this->num;
         	$data['yl_cash'] = round($data['ycash'] * $per, 2);
         	$data['pt_cash'] = round($data['ycash'] * $cash_jy_per, 2);
 	        $data['cash'] = round($data['ycash'] - $data['yl_cash'] - $data['pt_cash'], 2);
@@ -122,12 +124,12 @@ class Cash
 	        }
 	        $data['hf_cash'] = round($data['cash'] - $data['fz_cash'], 2);
 
-	        $data['ycash'] *= 100;
-	        $data['yl_cash'] *= 100;
-			$data['pt_cash'] *= 100;
-			$data['cash'] *= 100;
-			$data['fz_cash'] *= 100;
-			$data['hf_cash'] *= 100;
+	        $data['ycash'] *= $this->num;
+	        $data['yl_cash'] *= $this->num;
+			$data['pt_cash'] *= $this->num;
+			$data['cash'] *= $this->num;
+			$data['fz_cash'] *= $this->num;
+			$data['hf_cash'] *= $this->num;
 	    }
     }
 
@@ -170,19 +172,6 @@ class Cash
     	return false;
     }
 
-    # 定时获取总额
-
-    # 测试数据
-    public function test_add_api()
-    {
-    	$info['mid'] = 'test';
-    	$info['merOrderId'] = 'test123';
-    	$info['amount'] = 10000;
-
-    	$this->add('test123', array(), $info);
-    	return 'ok';
-    }
-
     # 将测试数据改成待入账
     public function test_edit_api()
     {
@@ -236,8 +225,8 @@ class Cash
     	$cash = Dever::param('cash', $data);
     	$merchant = Dever::db('pay/yspay_merchant')->one($merchant_id);
     	if ($merchant) {
-    		$cash = $cash*100;
-    		$yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'] - 10000;
+    		$cash = $cash*$this->num;
+    		$yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'] - $this->num*100;
     		if ($yue < $cash) {
     			Dever::alert('余额不足');
     		}

+ 3 - 2
yspay/Tixian.php

@@ -6,6 +6,7 @@ use Dever;
 
 class Tixian
 {
+    private $num = 1000;
     #生成订单号
     public function getOrderId()
     {
@@ -31,7 +32,7 @@ class Tixian
         if ($cash <= 0) {
         	Dever::alert('提现金额不能小于0');
         }
-        $cash = $cash * 100;
+        $cash = $cash * $this->num;
         if ($cash > $account['yue']) {
         	Dever::alert('账户余额不足');
         }
@@ -50,7 +51,7 @@ class Tixian
         if ($cash <= 0) {
         	Dever::alert('提现金额不能小于0');
         }
-        $cash = $cash * 100;
+        $cash = $cash * $this->num;
         if ($cash > $account['yue']) {
         	Dever::alert('账户余额不足');
         }