rabin 1 year ago
parent
commit
dbe0162129
2 changed files with 17 additions and 32 deletions
  1. 13 1
      database/yspay_merchant.php
  2. 4 31
      yspay/Cron.php

+ 13 - 1
database/yspay_merchant.php

@@ -50,6 +50,16 @@ return array
             'value'     => Dever::input('search_option_account_id'),
         ),
 
+        'pay/yspay-one#type'=> array
+        (
+            'name'      => '资金管理设置',
+            'default'   => '',
+            'desc'      => '资金管理设置',
+            'match'     => 'option',
+            # 读取另外表的关联方式
+            'sync'      => array('id' => 'account_id'),
+        ),
+
         'name'      => array
         (
             'type'      => 'varchar-300',
@@ -144,6 +154,7 @@ return array
             //'update'    => 'text',
             'list_name' => '资金总额 / 划付总额 / 分账总额',
             'list'      => 'Dever::number({cash}/100, 2) . " / " . Dever::number({hf_cash}/100, 2) . " / " . Dever::number({fz_cash}/100, 2)',
+            'auth'      => '{pay/yspay-one#type} == 2',
         ),
 
         'hf_cash'      => array
@@ -178,6 +189,7 @@ return array
             //'update'    => 'text',
             'list_name' => '账户余额 / 提现总额',
             'list'		=> 'Dever::number({yue}/100, 2) . " / " . Dever::number({tx_cash}/100, 2)',
+            'auth'      => '{pay/yspay-one#type} == 1',
         ),
 
         'tx_cash'      => array
@@ -259,7 +271,7 @@ return array
 
         	'list' => array('资金流水', '"yspay_cash&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1'),
 
-        	'list2' => array('提现管理', '"yspay_tixian&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1'),
+        	'list2' => array('提现管理', '"yspay_tixian&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1 && {pay/yspay-one#type} == 1'),
 
         	'list1' => array('签约日志', '"yspay_sign_log&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"'),
         ),

+ 4 - 31
yspay/Cron.php

@@ -13,7 +13,6 @@ class Cron
         if ($mid) {
             $where['mid'] = $mid;
         }
-        $test = Dever::input('test');
         $merchant = Dever::db('pay/yspay_merchant')->select($where);
         if (!$merchant) {
             return 'error';
@@ -21,38 +20,12 @@ class Cron
         foreach ($merchant as $k => $v) {
             if ($v['mid']) {
             	$config = Dever::db('pay/yspay')->one(array('account_id' => $v['account_id']));
-            	if ($config['type'] == 2) {
-            		$data = Dever::load('pay/yspay/multi')->yue($config, $v);
-            	} else {
+            	if ($config['type'] == 1) {
             		$data = Dever::load('pay/yspay/account')->query($v['mid']);
+            		$update['where_id'] = $v['id'];
+	                $update['yue'] = $data;
+	                Dever::db('pay/yspay_merchant')->update($update);
             	}
-                $update['where_id'] = $v['id'];
-                $update['yue'] = $data;
-                Dever::db('pay/yspay_merchant')->update($update);
-            }
-        }
-        return 'ok';
-    }
-
-    # 测试提现
-    public function test_tixian_api()
-    {
-        # 获取有银联商户号的门店
-        $where = array();
-        $mid = Dever::input('mid');
-        if ($mid) {
-            $where['mid'] = $mid;
-        }
-        $test = Dever::input('test');
-        $merchant = Dever::db('pay/yspay_merchant')->select($where);
-        if (!$merchant) {
-            return 'error';
-        }
-        foreach ($merchant as $k => $v) {
-            if ($v['mid']) {
-            	$config = Dever::db('pay/yspay')->one(array('account_id' => $v['account_id']));
-            	$data = Dever::load('pay/yspay/multi')->tixian($config, $v, $v['yue']);
-            	print_r($data);die;
             }
         }
         return 'ok';