rabin 1 рік тому
батько
коміт
5b9256bf91
1 змінених файлів з 30 додано та 31 видалено
  1. 30 31
      database/yspay_merchant.php

+ 30 - 31
database/yspay_merchant.php

@@ -14,6 +14,32 @@ $project = function()
 	return Dever::db('pay/yspay_project')->state();
 };
 
+$account_id = Dever::input('search_option_account_id');
+$yspay_type = 1;
+if ($account_id) {
+    $yspay = Dever::db('pay/yspay')->find($account_id);
+    $yspay_type = $yspay['type'];
+}
+
+$list_button = array
+(
+    'edit' => array('编辑'),
+
+    'add' => array('签约资料', '"yspay_sign&search_option_merchant_id={id}&where_id={id}&oper_table=account&oper_save_table=yspay_merchant"', '{status} == 2'),
+
+    'oper' => array('签约提审', 'pay/yspay/sign.handle?sign_id={id}', '"{pay/yspay_sign-one#step}" == -1 && {status} == 2'),
+    'fast' => array('签约打款', '"yspay_sign&where_id={id}&col=cash"', '"{pay/yspay_sign-one#step}" == 2 && {status} == 2'),
+    'copy' => array('签约合同', 'pay/yspay/sign.getAgreement?sign_id={id}', '"{pay/yspay_sign-one#step}" == 4 && {status} == 2'),
+
+    'list' => array('资金流水', '"yspay_cash&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1'),
+);
+
+if ($yspay_type == 1) {
+    $list_button['list2'] = array('提现管理', '"yspay_tixian&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1 && {pay/yspay-one#type} == 1');
+}
+
+$list_button['list1'] = array('签约日志', '"yspay_sign_log&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"');
+
 return array
 (
     # 表名
@@ -47,17 +73,7 @@ return array
             'desc'      => '账户id',
             'match'     => 'option',
             'update'    => 'hidden',
-            'value'     => Dever::input('search_option_account_id'),
-        ),
-
-        'pay/yspay-one#type'=> array
-        (
-            'name'      => '资金管理设置',
-            'default'   => '',
-            'desc'      => '资金管理设置',
-            'match'     => 'option',
-            # 读取另外表的关联方式
-            'sync'      => array('id' => 'account_id'),
+            'value'     => $account_id,
         ),
 
         'name'      => array
@@ -153,8 +169,7 @@ return array
             'match'     => 'option',
             //'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',
+            'list'      => $yspay_type == 1 ? false : 'Dever::number({cash}/100, 2) . " / " . Dever::number({hf_cash}/100, 2) . " / " . Dever::number({fz_cash}/100, 2)',
         ),
 
         'hf_cash'      => array
@@ -188,8 +203,7 @@ return array
             'match'     => 'option',
             //'update'    => 'text',
             'list_name' => '账户余额 / 提现总额',
-            'list'		=> 'Dever::number({yue}/100, 2) . " / " . Dever::number({tx_cash}/100, 2)',
-            'auth'      => '{pay/yspay-one#type} == 1',
+            'list'		=> $yspay_type == 2 ? false : 'Dever::number({yue}/100, 2) . " / " . Dever::number({tx_cash}/100, 2)',
         ),
 
         'tx_cash'      => array
@@ -259,22 +273,7 @@ return array
             '新增' => array('fast'),
         ),
 
-        'list_button' => array
-        (
-        	'edit' => array('编辑'),
-
-        	'add' => array('签约资料', '"yspay_sign&search_option_merchant_id={id}&where_id={id}&oper_table=account&oper_save_table=yspay_merchant"', '{status} == 2'),
-
-        	'oper' => array('签约提审', 'pay/yspay/sign.handle?sign_id={id}', '"{pay/yspay_sign-one#step}" == -1 && {status} == 2'),
-            'fast' => array('签约打款', '"yspay_sign&where_id={id}&col=cash"', '"{pay/yspay_sign-one#step}" == 2 && {status} == 2'),
-            'copy' => array('签约合同', 'pay/yspay/sign.getAgreement?sign_id={id}', '"{pay/yspay_sign-one#step}" == 4 && {status} == 2'),
-
-        	'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 && {pay/yspay-one#type} == 1'),
-
-        	'list1' => array('签约日志', '"yspay_sign_log&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"'),
-        ),
+        'list_button' => $list_button,
     ),
 
     'request' => array