rabin 2 年 前
コミット
b7fa0d97d7
19 ファイル変更1072 行追加258 行削除
  1. 23 0
      README.md
  2. 68 11
      database/config.php
  3. 12 0
      database/config_card.php
  4. 14 8
      database/config_type.php
  5. 14 10
      database/info.php
  6. 46 12
      database/info_log.php
  7. 200 0
      database/pay.php
  8. 141 0
      database/withdraw_info.php
  9. 25 0
      lib/Card.php
  10. 7 0
      lib/Config.php
  11. 32 97
      lib/Info.php
  12. 101 0
      lib/Log.php
  13. 117 0
      lib/Manage.php
  14. 155 0
      lib/Pay.php
  15. 30 0
      lib/Project.php
  16. 0 120
      src/Api.php
  17. 29 0
      src/Info.php
  18. 36 0
      src/Pay.php
  19. 22 0
      src/Withdraw.php

+ 23 - 0
README.md

@@ -0,0 +1,23 @@
+# 账户钱包组件
+
+使用方法:
+
+```
+# 用户id
+$uid = 1;
+# 金额
+$cash = 10;
+# 交易类型key
+$type = 'chongzhi';
+# 钱包key
+$account = 'qianbao';
+# 描述
+$desc = '';
+# 来源表
+$source = 'order/sell';
+# 来源表id
+$source_id = 1;
+# 自动还是手动 1是自动 2是手动,一般为1
+$state = 1;
+Dever::load('account/lib/info.up_commit', $uid, $cash, $type, $account, $desc, $source, $source_id, 1);
+```

+ 68 - 11
database/config.php

@@ -34,6 +34,22 @@ $type = array
 	2 => '普通账户',
 );
 
+$is_pay = array
+(
+	1 => '可以充值',
+	2 => '不可以充值',
+);
+
+$pay_channel = function()
+{
+	return Dever::load('pay/channel-state');
+};
+
+$pay_project = function()
+{
+	return Dever::load('pay/project-state');
+};
+
 return array
 (
 	# 表名
@@ -58,7 +74,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
-			//'list'		=> true,
+			'list'		=> true,
 		),
 		
 		'name'		=> array
@@ -142,6 +158,45 @@ return array
             'update'    => 'text',
         ),
 
+        'is_pay'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '是否可充值',
+            'default'   => '1',
+            'desc'      => '是否可充值',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $is_pay,
+            'control'	=> 'is_pay',
+            'tab'		=> 1,
+        ),
+
+        'pay_channel_id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '充值支付渠道',
+            'default'   => '1',
+            'desc'      => '充值支付渠道',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $pay_channel,
+            'tab'		=> 1,
+            'show'		=> 'is_pay=1',
+        ),
+
+        'pay_project_id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '充值支付项目',
+            'default'   => '1',
+            'desc'      => '充值支付项目',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $pay_project,
+            'tab'		=> 1,
+            'show'		=> 'is_pay=1',
+        ),
+
         'is_withdraw'        => array
         (
             'type'      => 'tinyint-1',
@@ -152,7 +207,7 @@ return array
             'update'    => 'radio',
             'option'    => $is_withdraw,
             'control'	=> 'is_withdraw',
-            'tab'		=> 1,
+            'tab'		=> 2,
         ),
 
         'withdraw_up'     => array
@@ -164,7 +219,7 @@ return array
             'match'     => 'option',
             'update'    => 'text',
             'show'		=> 'is_withdraw=1',
-            'tab'		=> 1,
+            'tab'		=> 2,
         ),
 
         'withdraw_down'     => array
@@ -176,7 +231,7 @@ return array
             'match'     => 'option',
             'update'    => 'text',
             'show'		=> 'is_withdraw=1',
-            'tab'		=> 1,
+            'tab'		=> 2,
         ),
 
         'withdraw_fee'     => array
@@ -188,7 +243,7 @@ return array
             'match'     => 'option',
             'update'    => 'text',
             'show'		=> 'is_withdraw=1',
-            'tab'		=> 1,
+            'tab'		=> 2,
         ),
 
         'withdraw_audit'        => array
@@ -201,7 +256,7 @@ return array
             'update'    => 'radio',
             'option'    => array(1 => '需要审核', 2 => '不需要审核'),
             'show'		=> 'is_withdraw=1',
-            'tab'		=> 1,
+            'tab'		=> 2,
         ),
 
         'withdraw_grant'        => array
@@ -214,7 +269,7 @@ return array
             'update'    => 'radio',
             'option'    => array(1 => '需要审核', 2 => '不需要审核'),
             'show'		=> 'is_withdraw=1',
-            'tab'		=> 1,
+            'tab'		=> 2,
         ),
 
         'withdraw_check'		=> array
@@ -226,7 +281,7 @@ return array
 			'match' 	=> 'option',
 			'update'	=> 'textarea',
 			'show'		=> 'is_withdraw=1',
-			'tab'		=> 1,
+			'tab'		=> 2,
 		),
 
         'reorder'		=> array
@@ -267,7 +322,9 @@ return array
 
 	'manage' => array
 	(
-		'tab' => array('基本配置', '提现配置'),
+		//'insert_check' => 'info',
+		'update_check' => 'info',
+		'tab' => array('基本配置', '充值配置', '提现配置'),
 		'button' => array
         (
             '项目配置' => array('list', 'config_project&parent=config'),
@@ -275,8 +332,8 @@ return array
         ),
         'list_button' => array
         (
-        	'list' => array('账户列表', '"info&search_option_config_id={id}&parent=config"'),
-        	'list1' => array('充值卡列表', '"config_card&search_option_config_id={id}&parent=config"'),
+        	'list' => array('账户列表', '"info&set_config_id={id}&parent=config"'),
+        	'list1' => array('充值卡列表', '"config_card&set_config_id={id}&parent=config"'),
         )
 	),
 

+ 12 - 0
database/config_card.php

@@ -107,6 +107,18 @@ return array
     'manage' => array
     (
         'link' => 'parent=config.config_card',
+        'insert' => false,
+        'edit' => false,
+
+        # 自定义快捷新增和编辑
+        'button' => array
+        (
+            '新增' => array('fast'),
+        ),
+        'list_button' => array
+        (
+            'edit' => array('编辑'),
+        )
     ),
 
     'request' => array

+ 14 - 8
database/config_type.php

@@ -48,7 +48,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
-			//'list'		=> true,
+			'list'		=> true,
 			'order'		=> 'asc',
 		),
 
@@ -72,7 +72,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '唯一标识',
 			'match' 	=> 'is_string',
-			'update'	=> ($id && $id < 3) ? false : 'text',
+			'update'	=> ($id && $id < 12) ? false : 'text',
 			'search'	=> 'fulltext',
 			'list'		=> true,
 		),
@@ -168,14 +168,20 @@ return array
 
 	'default' => array
 	(
-		'col' => 'name,`key`,project_id,type,manual,state,cdate',
+		'col' => 'id,name,`key`,project_id,type,manual,state,cdate',
 		'value' => array
 		(
-			'"充值", "chongzhi", -1, 1, 1, 1,' . DEVER_TIME,
-			'"提现", "tixian",-1, 2, 1, 1,' . DEVER_TIME,
-			'"采购", "caigou",-1, 2, 2, 1,' . DEVER_TIME,
-			'"购买", "goumai",-1, 2, 2, 1,' . DEVER_TIME,
-			'"销售", "xiaoshou",-1, 1, 2, 1,' . DEVER_TIME,
+			'1,"充值", "chongzhi", -1, 1, 1, 1,' . DEVER_TIME,
+			'2,"提现", "tixian",-1, 2, 1, 1,' . DEVER_TIME,
+			'3,"采购", "caigou",-1, 2, 2, 1,' . DEVER_TIME,
+			'4,"购买", "goumai",-1, 2, 2, 1,' . DEVER_TIME,
+			'5,"销售", "xiaoshou",-1, 1, 2, 1,' . DEVER_TIME,
+			'6,"收益", "shouyi",-1, 1, 2, 1,' . DEVER_TIME,
+			'7,"提现作废", "tixian_zuofei",-1, 1, 2, 1,' . DEVER_TIME,
+			'8,"购买退款", "goumai_tuikuan",-1, 1, 2, 1,' . DEVER_TIME,
+			'9,"采购退款", "caigou_tuikuan",-1, 1, 2, 1,' . DEVER_TIME,
+			'10,"销售退款", "xiaoshou_tuikuan",-1, 2, 2, 1,' . DEVER_TIME,
+			'11,"收益退款", "shouyi_tuikuan",-1, 2, 2, 1,' . DEVER_TIME,
 		),
 	),
 

+ 14 - 10
database/info.php

@@ -27,26 +27,28 @@ $config_key = Dever::input('config_key');
 if ($config_key) {
 	$info = Dever::db('account/config')->find(array('key' => $config_key));
 	if ($info) {
-		Dever::setInput('search_option_config_id', $info['id']);
+		Dever::setInput('set_config_id', $info['id']);
 	}
 }
 $uid = Dever::input('search_option_uid');
-$config_id = Dever::input('search_option_config_id');
-if ($config_id && $uid) {
-	$search_config = Dever::load('account/lib/info')->getSearch($config_id);
+$config_id = Dever::input('set_config_id');
+if ($config_id) {
+	$search_config = Dever::load('account/lib/manage')->getSearch($config_id);
 	if ($search_config) {
 		$search = $search_config;
 		$user = '用户名称';
 	}
 }
 
-$account_log = 'info_log&project=account&search_option_info_id={id}&search_option_uid={uid}&search_option_config_id={config_id}&';
+$account_log = 'info_log&project=account&search_option_info_id={id}&search_option_uid={uid}&set_config_id={config_id}&';
+$pay = 'pay&project=account&search_option_info_id={id}&search_option_uid={uid}set_config_id={config_id}&';
 
 $parent = Dever::input('parent');
+$link = '';
 if ($parent) {
-	$account_log .= 'parent=' . $parent . '.account/info';
+	$link = 'parent=' . $parent . '.account/info';
 } else {
-	$account_log .= 'parent=account/info';
+	$link = 'parent=account/info';
 }
 return array
 (
@@ -79,7 +81,7 @@ return array
             'search'	=> $search,
             'value'     => $uid,
             'list_name'	=> '用户名称',
-			'list'		=> 'Dever::load("account/lib/info.getName", {uid}, {config_id})',
+			'list'		=> 'Dever::load("account/lib/project.getUsername", {uid}, {config_id})',
 		),
 
 		'config_id'		=> array
@@ -91,7 +93,7 @@ return array
 			'match' 	=> 'is_numeric',
 			'update'	=> 'select',
 			'option'	=> $config,
-			'search'	=> 'select',
+			//'search'	=> 'select',
 			'list'		=> true,
 		),
 
@@ -174,6 +176,7 @@ return array
 
 	'manage' => array
 	(
+		'link' => $link,
 		'delete' => false,
 		'edit' => false,
 		'insert' => false,
@@ -181,8 +184,9 @@ return array
 		# 列表
 		'list_button' => array
 		(
-			'fast_add' => array('账户操作', 'push&project=account&search_option_config_id={config_id}&search_option_uid={uid}'),
+			'fast_add' => array('账户操作', 'push&project=account&set_config_id={config_id}&search_option_uid={uid}'),
 			'list' => array('账户流水', $account_log),
+			'list1' => array('充值记录', $pay),
 		),
 	),
 

+ 46 - 12
database/info_log.php

@@ -40,22 +40,23 @@ $config_key = Dever::input('config_key');
 if ($config_key) {
     $info = Dever::db('account/config')->find(array('key' => $config_key));
     if ($info) {
-        Dever::setInput('search_option_config_id', $info['id']);
+        Dever::setInput('set_config_id', $info['id']);
     }
 }
 $uid = Dever::input('search_option_uid');
-$config_id = Dever::input('search_option_config_id');
+$config_id = Dever::input('set_config_id');
 if ($config_id && $uid) {
-	$search_config = Dever::load('account/lib/info')->getSearch($config_id);
+	$search_config = Dever::load('account/lib/manage')->getSearch($config_id);
 	if ($search_config) {
 		$search = $search_config;
 		$user = '用户名称';
 
         $button['账户操作'] = array('fast', false, 'push');
+        $button['设置提现人'] = array('fast', false, 'withdraw_info');
 
         $account_info = Dever::db('account/info')->find(array('config_id' => $config_id, 'uid' => $uid));
         if ($account_info) {
-            $username = Dever::load("account/lib/info.getName", $uid, $config_id);
+            $username = Dever::load("account/lib/project.getUsername", $uid, $config_id);
             $desc = '<blockquote class="layui-elem-quote">';
             $desc .= $search_config['project_name'] . '.' . $search_config['name'];
             $desc .= ' -> ';
@@ -102,6 +103,11 @@ return array
     'menu' => false,
     'info' => $desc,
     'order' => 99,
+    'end' => array
+    (
+        'update' => 'account/lib/manage.audit',
+        'updatemul' => 'account/lib/manage.audit',
+    ),
     # 数据结构
     'struct' => array
     (
@@ -117,6 +123,17 @@ return array
             //'list'        => true,
         ),
 
+        'order_num'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '流水号',
+            'default'   => '',
+            'desc'      => '流水号',
+            'match'     => 'is_string',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
         'info_id'		=> array
 		(
 			'type' 		=> 'int-11',
@@ -124,6 +141,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '账户id',
 			'match' 	=> 'is_numeric',
+            'search'    => 'hidden',
 		),
 
         'uid'		=> array
@@ -133,10 +151,10 @@ return array
 			'default' 	=> '0',
 			'desc' 		=> '用户名称',
 			'match' 	=> 'is_numeric',
-            'search'	=> $search,
+            'search'	=> 'hidden',
             'value'     => $uid,
             'list_name'	=> '用户名称',
-			'list'		=> 'Dever::load("account/lib/info.getName", {uid}, {config_id})',
+			'list'		=> 'Dever::load("account/lib/project.getUsername", {uid}, {config_id})',
             //'list'      => true,
 		),
 
@@ -149,8 +167,8 @@ return array
 			'match' 	=> 'is_numeric',
 			'update'	=> 'select',
 			'option'	=> $config,
-			'search'	=> 'select',
-			'list'		=> true,
+			//'search'	=> 'select',
+			//'list'		=> true,
 		),
 
 		'project_id'        => array
@@ -172,6 +190,7 @@ return array
             'default'   => '1',
             'desc'      => '交易类型',
             'match'     => 'is_numeric',
+            'search'    => 'select',
             'update'    => 'radio',
             'option'    => $type,
             'list'		=> true,
@@ -270,7 +289,8 @@ return array
             'default'   => '',
             'match'     => 'is_numeric',
             'desc'      => '审核人',
-            'list'      => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
+            //'list'      => '"{audit_admin}" > 0 ? Dever::load("user/lib/info.get#name", {audit_admin}) : "-"',
+            'list'      => 'user/lib/info.get#name',
         ),
 
         'audit_status'        => array
@@ -304,7 +324,7 @@ return array
             'match'     => 'is_numeric',
             'desc'      => '审核时间',
             'default'   => '',
-            'list'      => '{audit_date} ? date("Y-m-d H:i:s", {audit_date}) : "-"',
+            'list'      => 'time',
         ),
 
         'state'     => array
@@ -326,7 +346,7 @@ return array
             'insert'    => true,
             'search'    => 'date',
             'list_name' => '交易时间',
-            'list'        => 'date("Y-m-d H:i", {cdate})',
+            'list'        => 'time',
         ),
     ),
 
@@ -336,6 +356,7 @@ return array
         'delete' => false,
         'edit' => false,
         'button' => $button,
+        'excel' => true,
         # 列表
         'list_button' => array
         (
@@ -345,6 +366,19 @@ return array
 
     'request' => array
     (
-        
+        'getData' => array
+        (
+            'type' => 'all',
+            'option' => array
+            (
+                'config_id' => 'yes',
+                'info_id' => 'yes',
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
+                'state' => 1,
+            ),
+            'page' => array(10, 'list'),
+            'col' => '*',
+        ),
     ),
 );

+ 200 - 0
database/pay.php

@@ -0,0 +1,200 @@
+<?php
+$config = function()
+{
+	$array = array();
+	$info = Dever::db('account/config')->state();
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+$project = function()
+{
+	$array = array();
+	$data = Dever::load('account/config_project-state');
+	if($data)
+	{
+		$array += $data;
+	}
+	return $array;
+};
+$status = Dever::config('base', 'pay')->pay['status'];
+
+return array
+(
+    # 表名
+    'name' => 'pay',
+    # 显示给用户看的名称
+    'lang' => '充值订单',
+    'order' => 30,
+    'menu' => false,
+
+
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            //'list'      => true,
+        ),
+
+        'order_num'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '订单号',
+            'default'   => '',
+            'desc'      => '订单号',
+            'match'     => 'is_string',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'config_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '账户名称',
+			'default' 	=> '1',
+			'desc' 		=> '账户名称',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'select',
+			'option'	=> $config,
+			//'search'	=> 'select',
+			'list'		=> true,
+		),
+
+		'info_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '账户id',
+			'default' 	=> '',
+			'desc' 		=> '账户id',
+			'match' 	=> 'is_numeric',
+		),
+
+        'card_id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '充值卡',
+            'default'   => '',
+            'desc'      => '充值卡',
+            'match'     => 'is_numeric',
+            'list'		=> '"{card_id}" ? Dever::load("account/config_card-find#name", {card_id}) : "-"',
+        ),
+
+        'uid'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '购买人-输入用户手机号或者用户名',
+            'default'   => '',
+            'desc'      => '购买人',
+            'match'     => 'is_numeric',
+            'search'    => array
+            (
+                'api' => 'user/info-like',
+                'col' => 'search',
+                'result' => 'id',
+            ),
+            'update'    => 'select',
+            'update_search' => 'user/lib/info.manage_search',
+            'list'       => '"{uid}" ? Dever::load("user/lib/info.get#aname", {uid}) : "暂无"',
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '充值信息',
+            'default'   => '',
+            'desc'      => '充值信息',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'cash'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '充值金额',
+            'default'   => '',
+            'desc'      => '充值金额',
+            'match'     => 'option',
+            //'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'price'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '实付金额',
+            'default'   => '',
+            'desc'      => '实付金额',
+            'match'     => 'option',
+            //'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'yue'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '充值后余额',
+            'default'   => '',
+            'desc'      => '充值后余额',
+            'match'     => 'option',
+            //'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '订单状态',
+            'default'   => '1',
+            'desc'      => '订单状态',
+            'match'     => 'is_numeric',
+            'option'    => $status,
+            'search'    => 'select',
+            'list'      => true,
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '下单时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'sdate',
+            'list'        => 'date("Y-m-d H:i", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        'delete' => false,
+        'edit' => false,
+        'insert' => false,
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 141 - 0
database/withdraw_info.php

@@ -0,0 +1,141 @@
+<?php
+$sign = array
+(
+	1 => '已签约',
+	2 => '未签约',
+);
+$agreement = array
+(
+	1 => '已签署',
+	2 => '未签署',
+);
+return array
+(
+	# 表名
+	'name' => 'withdraw_info',
+	# 显示给用户看的名称
+	'lang' => '提现人信息',
+	'order' => 100,
+	'menu' => false,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			//'list'		=> true,
+		),
+
+		'info_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '账户id',
+			'default' 	=> '',
+			'desc' 		=> '账户id',
+			'match' 	=> 'is_numeric',
+            'search'    => 'hidden',
+            'update'	=> 'hidden',
+            'value'		=> Dever::input('search_option_info_id'),
+		),
+
+		'name'		=> array
+		(
+			'type'      => 'varchar-200',
+			'name' 		=> '提现人姓名',
+			'default' 	=> '',
+			'desc' 		=> '提现人姓名',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'list'		=> true,
+		),
+
+		'idcard'		=> array
+		(
+			'type'      => 'varchar-200',
+			'name' 		=> '提现人身份证号',
+			'default' 	=> '',
+			'desc' 		=> '提现人身份证号',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'list'		=> true,
+		),
+
+		'mobile'		=> array
+		(
+			'type'      => 'varchar-11',
+			'name' 		=> '提现人手机号',
+			'default' 	=> '',
+			'desc' 		=> '提现人手机号',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'list'		=> true,
+		),
+
+		'sign'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '是否已签约-这里也可以不做改动,如不做改动会自动从第三方接口中获取签约状态',
+            'default'   => '2',
+            'desc'      => '是否已签约',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $sign,
+        ),
+
+        'agreement'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '是否签署合同协议',
+            'default'   => '2',
+            'desc'      => '是否签署合同协议',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $agreement,
+        ),
+
+        'agreement_pic'     => array
+        (
+			'type'      => 'varchar-150',
+			'name'      => '合同协议图片',
+			'default'   => ' ',
+			'desc'      => '合同协议图片',
+			'match'     => 'option',
+			'update'    => 'image',
+			'key'       => '1',
+		),
+
+		'state'		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '状态',
+			'default' 	=> '1',
+			'desc' 		=> '请选择状态',
+			'match' 	=> 'is_numeric',
+		),
+
+		'cdate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '录入时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+			# 只有insert时才生效
+			'insert'	=> true,
+		),
+	),
+
+	'manage' => array
+	(
+		
+	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		
+	)
+);

+ 25 - 0
lib/Card.php

@@ -0,0 +1,25 @@
+<?php
+namespace Account\Lib;
+use Dever;
+class Card
+{
+    # 获取充值卡
+    public function getInfo($card_id, $config_id)
+    {
+        $where['config_id'] = $config_id;
+        $where['id'] = $card_id;
+        $data = Dever::db('account/config_card')->find($where);
+        if (!$data) {
+            Dever::alert('充值卡不存在');
+        }
+        return $data;
+    }
+
+    # 获取充值卡列表
+    public function getList($config_id)
+    {
+        $where['config_id'] = $config_id;
+        $data = Dever::db('account/config_card')->select($where);
+        return $data;
+    }
+}

+ 7 - 0
lib/Config.php

@@ -0,0 +1,7 @@
+<?php
+namespace Account\Lib;
+use Dever;
+class Config
+{
+	
+}

+ 32 - 97
lib/Info.php

@@ -1,105 +1,51 @@
 <?php
-
 namespace Account\Lib;
-
 use Dever;
-
 class Info
 {
-    # 获取账户
-    public function getInfo($uid, $config_id = false)
+    # 获取用户账户基本信息
+    public function getUserInfo($uid, $config_id = false)
     {
-        if (!$config_id) {
-            $config = Dever::db('account/config')->one(array('type' => 1));
-        } else {
-            $config = Dever::db('account/config')->one($config_id);
-        }
-        
-        if ($config) {
-            $where = array();
-            $where['uid'] = $uid;
-            $where['config_id'] = $config['id'];
-            $account = Dever::db('account/info')->one($where);
-            if ($account) {
-                return array('name' => $config['name'], 'cash' => $account['cash'], 'z_cash' => $account['z_cash'], 't_cash' => $account['t_cash']);
-            } else {
-                return array();
-            }
-        }
-
-        return array();
+        $info = $this->getInfo($uid, $config_id);
+        return array('name' => $info['config']['name'], 'cash' => $info['cash']);
     }
 
-    # 获取列表
-    public function getList($uid, $config_id = false, $type = false, $type_id = false)
+    # 获取账户信息
+    public function getInfo($uid, $config_id = false, $check = 0)
     {
-        if (!$config_id) {
-            $config = Dever::db('account/config')->one(array('type' => 1));
+        $key = Dever::input('account_key');
+        if ($key) {
+            $config = Dever::db('account/config')->one(array('key' => $account));
         } else {
-            $config = Dever::db('account/config')->one($config_id);
+            if (!$config_id) {
+                $config = Dever::db('account/config')->one(array('type' => 1));
+            } else {
+                $config = Dever::db('account/config')->one($config_id);
+            }
         }
         
         if ($config) {
+            # 检测是否可以充值
+            if ($check == 1 && $config['is_pay'] == 2) {
+                Dever::alert('当前账户不允许充值');
+            }
+            # 检测是否可以提现
+            if ($check == 2 && $config['is_withdraw'] == 2) {
+                Dever::alert('当前账户不允许提现');
+            }
             $where = array();
             $where['uid'] = $uid;
             $where['config_id'] = $config['id'];
-
-            $result = Dever::db('account/info_log')->getList($where);
-        }
-
-        if ($result) {
-            $type = Dever::db('account/config_type')->getData();
-            foreach ($result as $k => $v) {
-                $result[$k]['cdate'] = date('Y-m-d H:i', $v['cdate']);
-                if (isset($type[$v['type_id']])) {
-                    $result[$k]['type_name'] = $type[$v['type_id']]['name'];
-                } else {
-                    $result[$k]['type_name'] = '未知';
-                }
-            }
-        }
-        
-        return $result;
-    }
-
-    public function test_api()
-    {
-        //return $this->up(1, 500, 'tixian', 'role_zijin', 'test');
-        return $this->up_commit(1, 1, 'chongzhi', 'role_zijin', 'test');
-    }
-
-    public function getName($uid, $config_id)
-    {
-        $name = $uid;
-        $info = Dever::db('account/config')->find($config_id);
-        if ($info) {
-        	$project = Dever::db('account/config_project')->find($info['project_id']);
-            $source = Dever::db($project['source'])->find($uid);
-            if ($source) {
-                return $source[$project['source_name']];
+            $account = Dever::db('account/info')->one($where);
+            if (!$account) {
+                $id = Dever::db('account/info')->insert($where);
+                $account = Dever::db('account/info')->one($id);
             }
+            $account['config'] = $config;
+            return $account;
+        } else {
+            Dever::alert('钱包配置不存在');
         }
-        return $name;
-    }
-
-    public function getSearch($config_id)
-    {
-        $result = '';
-        $info = Dever::db('account/config')->find($config_id);
-        if ($info) {
-            $project = Dever::db('account/config_project')->find($info['project_id']);
-            $result = array
-            (
-                'api' => $project['source'] . '-all',
-                'col' => $project['source_name'],
-                'result' => 'id',
-                'search' => 'uid',
-                'project_name' => $project['name'],
-                'name' => $info['name'],
-            );
-        }
-        
-        return $result;
     }
 
     # 入账
@@ -127,7 +73,6 @@ class Info
         if ($type['project_id'] != -1 && $type['project_id'] != $config['project_id']) {
             return $this->alert('交易类型不正确', $state);
         }
-        $data['status'] = 2;
         $data['uid'] = $uid;
         $data['config_id'] = $config['id'];
         $data['project_id'] = $config['project_id'];
@@ -140,13 +85,13 @@ class Info
             }
             $info['cash'] = 0;
         }
+        $data['status'] = 2;
 
         $func = 'inc';
         if ($type['type'] == 2) {
             if ($info['cash'] < $cash) {
                 return $this->alert('账户余额不足', $state);
             }
-            $cash = -1*$cash;
             $func = 'dec';
         }
         $data['info_id'] = $info['id'];
@@ -207,17 +152,7 @@ class Info
 
         $yue = $data['yue'];
         $data['method'] = $method;
-        if ($data['status'] == 2) {
-            $admin = Dever::load('manage/auth.data');
-            if ($admin) {
-                $data['audit_admin'] = $admin['id'];
-            }
-            $data['audit_date'] = time();
-        }
-        
-        $data['clear'] = true;
-
-        $id = Dever::db('account/info_log')->insert($data);
+        $id = Dever::load('account/lib/log')->create($data);
         if ($id) {
             $update = array();
             $update['where_id'] = $info['id'];

+ 101 - 0
lib/Log.php

@@ -0,0 +1,101 @@
+<?php
+namespace Account\Lib;
+use Dever;
+class Log
+{
+    # 创建钱包日志
+    public function create($data)
+    {
+        if ($data['status'] == 2) {
+            $admin = Dever::load('manage/auth.data');
+            if ($admin) {
+                $data['audit_admin'] = $admin['id'];
+            }
+            $data['audit_date'] = time();
+        }
+        $data['order_num'] = $this->createOrderNum();
+        return Dever::db('account/info_log')->insert($data);
+    }
+
+    # 生成订单号
+    private function createOrderNum()
+    {
+        $where['order_num'] = Dever::order('A');
+        $state = Dever::db('account/info_log')->one($where);
+        if (!$state) {
+            return $where['order_num'];
+        } else {
+            return $this->createOrderNum();
+        }
+    }
+
+    # 获取日志列表
+    public function getList($config_id, $info_id)
+    {
+        $where['config_id'] = $config_id;
+        $where['info_id'] = $info_id;
+        list($start, $end) = Dever::month();
+        if ($start && $end) {
+            $where['start'] = $start;
+            $where['end'] = $end;
+        }
+        $data = Dever::db('account/info_log')->getData($where, function(&$info) {
+            return $this->info($info);
+        });
+
+        return $data;
+    }
+
+    # 根据来源获取日志列表
+    public function getListBySource($source, $source_id)
+    {
+        $where['source'] = $source;
+        $where['source_id'] = $source_id;
+        $data = Dever::db('account/info_log')->select($where, function(&$info) {
+            return $this->info($info);
+        });
+
+        return $data;
+    }
+
+    # 获取日志详情
+    public function getInfo($id)
+    {
+        $data = Dever::db('account/info_log')->find($id);
+        $data = $this->info($data);
+        return $data;
+    }
+
+    # 获取详情
+    private function info($info)
+    {
+        $info['username'] = '无';
+        $config = Dever::db('account/config')->find($info['config_id']);
+        $project = Dever::db('account/config_project')->find($config['project_id']);
+        $source = Dever::db($project['source'])->find($info['uid']);
+        if ($source) {
+            $info['username'] = $source[$project['source_name']];
+        }
+        $info['config_name'] = $config['name'];
+        if ($info['type_id'] == 2) {
+            if ($info['status'] == 1) {
+                $info['status_name'] = '待审核';
+            } elseif ($info['status'] == 2) {
+                $info['status_name'] = '已审核(待发放)';
+            } elseif ($info['status'] == 3) {
+                $info['status_name'] = '已审核(已发放)';
+            } else {
+                $info['status_name'] = '已作废';
+            }
+        } elseif ($info['status'] == 2) {
+            $info['status_name'] = '已入账';
+        } else {
+            $info['status_name'] = '待入账';
+        }
+        
+        $info['type_name'] = Dever::load("account/config_type-one#name", $info['type_id']);
+        $info['cdate'] = date('Y-m-d H:i', $info['cdate']);
+        $info['fee'] = Dever::number($info['ycash'] - $info['cash']);
+        return $info;
+    }
+}

+ 117 - 0
lib/Manage.php

@@ -48,4 +48,121 @@ class Manage
             Dever::db('account/config')->update(array('where_id' => $id, 'type' => 1));
         }
     }
+
+    public function getSearch($config_id)
+    {
+        $result = '';
+        $info = Dever::db('account/config')->find($config_id);
+        if ($info) {
+            $project = Dever::db('account/config_project')->find($info['project_id']);
+            $result = array
+            (
+                'api' => $project['source'] . '-all',
+                'col' => $project['source_name'],
+                'result' => 'id',
+                'search' => 'uid',
+                'project_name' => $project['name'],
+                'name' => $info['name'],
+            );
+        }
+        
+        return $result;
+    }
+
+    # 获取钱包信息
+    public function getInfo($uid, $account)
+    {
+        if (!$account) {
+            return '无账户信息';
+        }
+        $config = Dever::db('account/config')->getData(array('ids' => $account));
+
+        $table = array();
+        $table['head'] = array('账户名称', '余额', '总获取金额', '总消耗金额');
+        $table['body'] = array();
+
+        if ($config) {
+            foreach ($config as $k => $v) {
+                $info = Dever::db('account/info')->find(array('uid' => $uid, 'config_id' => $v['id']));
+                if ($info) {
+                    $table['body'][$k] = array
+                    (
+                        $v['name'], $info['cash'], $info['z_cash'], $info['t_cash']
+                    );
+                }
+            }
+        }
+        
+        $body[''] = array
+        (
+            'type' => 'table',
+            'content' => $table,
+        );
+
+        if ($table['body']) {
+            return Dever::show('', $body);
+        } else {
+            return '无账户信息';
+        }
+    }
+
+    # 获取日志记录
+    public function getLog($order_table, $order_id)
+    {
+        $log = Dever::load('account/lib/log')->getListBySource($source, $source_id);
+        if ($log) {
+            $content['head'] = array('用户名称', '账户名称', '交易类型', '金额', '操作后余额', '资金说明', '交易时间');
+            $content['body'] = array();
+
+            foreach ($log as $k => $v) {
+                $detail = array();
+                $detail[] = $v['username'];
+                $detail[] = $v['config_name'];
+                $detail[] = $v['type_name'];
+                $detail[] = $v['cash'];
+                $detail[] = $v['yue'];
+                $detail[] = $v['desc'];
+                $detail[] = $v['cdate'];
+                $content['body'][] = $detail;
+            }
+            return array
+            (
+                'type' => 'table',
+                'content' => $content,
+            );
+        }
+        return array();
+    }
+
+    # 资金审核
+    public function audit($id, $name, $data)
+    {
+        Dever::config('base')->hook = true;
+        $audit = Dever::param('audit_status', $data);
+        if ($audit > 1) {
+            $list = Dever::mul($id);
+            foreach ($list as $k => $v) {
+                if (is_array($v)) {
+                    $id = $v['id'];
+                    $info = Dever::db('account/info_log')->find(array('id' => $id, 'clear' => true));
+                } else {
+                    $id = $v;
+                    $info = Dever::db('account/info_log')->find(array('id' => $id, 'clear' => true));
+                }
+
+                if ($info['status'] != 1) {
+                    continue;
+                }
+                # 已作废
+                if ($audit == 4) {
+                    Dever::load('account/lib/info.up_commit', $info['uid'], $info['cash'], 'tixian_zuofei', 'qianbao', $desc, 'account/pay', $order['id']);
+                }
+
+                $update = array('where_id' => $id, 'status' => $audit, 'audit_date' => time());
+                $admin = Dever::load('manage/auth.data');
+                $update['audit_admin'] = $admin['id'];
+                Dever::db('account/info_log')->update($update);
+            }
+        }
+    }
 }

+ 155 - 0
lib/Pay.php

@@ -0,0 +1,155 @@
+<?php
+# 充值
+namespace Account\Lib;
+
+use Dever;
+
+class Pay
+{
+	# 支付项目
+    private $project_id = 1;
+    # 支付渠道
+    private $channel_id = 1;
+    # 支付类型:5是小程序
+    private $system_source = 5;
+    # 生成订单
+    public function create($data)
+    {
+    	$order = [
+            'order_num' => $this->createOrderNum(),
+            'config_id' => $data['config_id'],
+            'info_id' => $data['info_id'],
+            'card_id' => $data['card_id'],
+            'uid' => $data['uid'],
+            'username' => $data['username'],
+            'name' => $data['name'],
+            'cash' => $data['cash'],
+            'price' => $data['price'],
+            'yue' => $data['yue'],
+        ];
+        $order['id'] = Dever::db('account/pay')->insert($order);
+        if ($order['id']) {
+        	# 需要支付
+        	if ($data['pay_channel_id']) {
+        		$this->channel_id = $data['pay_channel_id'];
+        	}
+        	if ($data['pay_project_id']) {
+        		$this->project_id = $data['pay_project_id'];
+        	}
+	        if ($order['price'] > 0) {
+	            return $this->yes($order);
+	        } else {
+	            return $this->no($order);
+	        }
+        }
+        Dever::alert('支付失败');
+    }
+
+    # 生成订单号
+    private function createOrderNum()
+    {
+        $where['order_num'] = Dever::order('P');
+        $state = Dever::db('account/pay')->one($where);
+        if (!$state) {
+            return $where['order_num'];
+        } else {
+            return $this->createOrderNum();
+        }
+    }
+
+    # 支付
+    private function yes($order)
+    {
+        $openid = Dever::load('user/lib/applet')->getOpenid($order['uid'], $this->system_source, $this->project_id);
+        $param = array(
+            'project_id' => $this->project_id,
+            'channel_id' => $this->channel_id,
+            'system_source' => $this->system_source,
+            'uid' => $order['uid'],
+            'username' => isset($order['username']) ? $order['username'] : '',
+            'name' => $order['name'],
+            'cash' => $order['price'],
+            'product_id' => $order['id'],
+            'order_id' => $order['order_num'],
+            'openid' => $openid,
+        );
+        $data = Dever::load('pay/api.pay', $param);
+        $data['order_cash'] = Dever::number($order['cash']);
+        $data['order_yue'] = Dever::number($order['yue']);
+        $data['order_num'] = $order['order_num'];
+        $data['order_id'] = $order['id'];
+        return $data;
+    }
+
+    # 无需支付
+    private function no($order)
+    {
+        $param['pay_product_id'] = $order['id'];
+        $param['pay_order_id'] = $order['order_num'];
+        $param['pay_status'] = 2;
+        $param['pay_cash'] = $order['price'];
+        $param['pay_msg'] = '';
+        $this->success($param);
+        return array(
+            'order' => '',
+            'order_cash' => Dever::number($order['cash']),
+        	'order_yue' => Dever::number($order['yue']),
+            'order_num' => $order['order_num'],
+            'order_id' => $order['id'],
+            'type' => 'test',
+        );
+    }
+
+    # 支付成功回调 安全加密 设置token
+    public function success_secure_api_token()
+    {
+        $project_id = Dever::input('pay_project_id');
+        $info = Dever::db('pay/project')->one($project_id);
+        if ($info) {
+            return $info['key'];
+        }
+        return 'account_dever';
+    }
+
+    # 支付成功回调 安全加密
+    public function success_secure_api($param = array())
+    {
+        $this->success($param);
+    }
+
+    # 支付成功回调
+    public function success($param = array())
+    {
+        $send = $param ? $param : Dever::preInput('pay_');
+        $product_id = $send['pay_product_id'];
+        $order_id = $send['pay_order_id'];
+        $status = $send['pay_status'];
+        $cash = $send['pay_cash'];
+        $msg = $send['pay_msg'];
+
+        $order = Dever::db('account/pay')->one(array('id' => $product_id, 'clear' => true));
+        if ($order && $order['status'] == 1) {
+            $update = array();
+            if ($status == 2) {
+                $update['status'] = $status;
+                $update['where_id'] = $order['id'];
+                Dever::db('account/pay')->update($update);
+
+                $desc = '支付充值';
+                Dever::load('account/lib/info.up_commit', $order['uid'], $order['cash'], 'chongzhi', 'qianbao', $desc, 'account/pay', $order['id']);
+
+                # 发消息
+                if ($order['uid'] && $order['uid'] > 0) {
+                	$this->payNotice($order);
+                }
+            }
+        }
+
+        return 'ok';
+    }
+
+    public function payNotice($order)
+    {
+    	
+    }
+}

+ 30 - 0
lib/Project.php

@@ -0,0 +1,30 @@
+<?php
+namespace Account\Lib;
+use Dever;
+class Project
+{
+	public function getConfig($table)
+    {
+    	$data = array();
+        $project = Dever::db('account/config_project')->find(array('source' => $table));
+        if ($project) {
+        	$data = Dever::db('account/config')->select(array('project_id' => $project['id']));
+        }
+
+        return $data;
+    }
+
+    public function getUsername($uid, $config_id)
+    {
+        $name = $uid;
+        $info = Dever::db('account/config')->find($config_id);
+        if ($info) {
+        	$project = Dever::db('account/config_project')->find($info['project_id']);
+            $source = Dever::db($project['source'])->find($uid);
+            if ($source) {
+                return $source[$project['source_name']];
+            }
+        }
+        return $name;
+    }
+}

+ 0 - 120
src/Api.php

@@ -1,120 +0,0 @@
-<?php
-
-namespace Account\Src;
-
-use Dever;
-
-class Api
-{
-    public function getConfig($table)
-    {
-    	$data = array();
-        $project = Dever::db('account/config_project')->find(array('source' => $table));
-        if ($project) {
-        	$data = Dever::db('account/config')->select(array('project_id' => $project['id']));
-        }
-
-        return $data;
-    }
-
-    public function getOne($uid, $account)
-    {
-        if (!$account) {
-            return array();
-        }
-        $config = Dever::db('account/config')->one($account);
-
-        $result = array();
-
-        if ($config) {
-            $info = Dever::db('account/info')->find(array('uid' => $uid, 'config_id' => $config['id']));
-            if ($info) {
-                $info['name'] = $config['name'];
-                $result = $info;
-            }
-        }
-        
-        return $result;
-    }
-
-    public function getInfo($uid, $account)
-    {
-        if (!$account) {
-            return array();
-        }
-        $config = Dever::db('account/config')->getData(array('ids' => $account));
-
-        $result = array();
-
-        if ($config) {
-            foreach ($config as $k => $v) {
-                $info = Dever::db('account/info')->find(array('uid' => $uid, 'config_id' => $v['id']));
-                if ($info) {
-                    $info['name'] = $v['name'];
-                    $result[$k] = $info;
-                }
-            }
-        }
-        
-        return $result;
-    }
-
-    public function getTableInfo($uid, $account)
-    {
-    	if (!$account) {
-    		return '无账户信息';
-    	}
-    	$config = Dever::db('account/config')->getData(array('ids' => $account));
-
-    	$table = array();
-        $table['head'] = array('账户名称', '余额', '总获取金额', '总消耗金额');
-        $table['body'] = array();
-
-        if ($config) {
-        	foreach ($config as $k => $v) {
-        		$info = Dever::db('account/info')->find(array('uid' => $uid, 'config_id' => $v['id']));
-        		if ($info) {
-        			$table['body'][$k] = array
-                    (
-                        $v['name'], $info['cash'], $info['z_cash'], $info['t_cash']
-                    );
-        		}
-        	}
-        }
-        
-        $body[''] = array
-        (
-            'type' => 'table',
-            'content' => $table,
-        );
-
-        if ($table['body']) {
-            return Dever::show('', $body);
-        } else {
-            return '无账户信息';
-        }
-    }
-
-    # 获取日志
-    public function getLogBySource($source, $source_id)
-    {
-        $where['source'] = $source;
-        $where['source_id'] = $source_id;
-        $data = Dever::db('account/info_log')->select($where, function(&$info) {
-            $info['username'] = '无';
-            $config = Dever::db('account/config')->find($info['config_id']);
-            $project = Dever::db('account/config_project')->find($config['project_id']);
-            $source = Dever::db($project['source'])->find($info['uid']);
-            if ($source) {
-                $info['username'] = $source[$project['source_name']];
-            }
-            
-            $info['configname'] = $config['name'];
-            $info['typename'] = Dever::load("account/config_type-one#name", $info['type_id']);
-            $info['cdate'] = date('Y-m-d H:i', $info['cdate']);
-            return $info;
-        });
-
-        return $data;
-    }
-}

+ 29 - 0
src/Info.php

@@ -0,0 +1,29 @@
+<?php
+namespace Account\Src;
+use Dever;
+use User\Lib\Core;
+class Info extends Core
+{
+    public function getHome()
+    {
+        $data['account'] = Dever::load('account/lib/info')->getInfo($this->uid);
+        # 获取最新月份
+
+        $data['log'] = Dever::load('account/lib/log')->getList($data['account']['config_id'], $data['account']['id']);
+        return $data;
+    }
+
+    public function getView()
+    {
+        $id = Dever::input('id');
+        return Dever::load('account/lib/log')->getInfo($id);
+    }
+
+    # 获取钱包充值卡
+    public function getCard()
+    {
+        $data['account'] = Dever::load('account/lib/info')->getInfo($this->uid);
+        $data['card'] = Dever::load('account/lib/card')->getList($data['account']['config_id']);
+        return $data;
+    }
+}

+ 36 - 0
src/Pay.php

@@ -0,0 +1,36 @@
+<?php
+namespace Account\Src;
+use Dever;
+use User\Lib\Core;
+class Pay extends Core
+{
+    # 充值
+    public function act()
+    {
+    	$account = Dever::load('account/lib/info')->getInfo($this->uid, false, 1);
+    	if ($account)
+    	$cash = $price = Dever::input('cash');
+    	$card_id = Dever::input('card_id');
+    	if ($card_id) {
+    		$card = Dever::load('account/lib/card')->getInfo($card_id, $account['config_id']);
+    		$cash = $card['cash'];
+    		$price = $card['pay'];
+    	}
+    	if (!$cash) {
+    		Dever::alert('请输入充值金额');
+    	}
+        $data['uid'] = $this->uid;
+        $data['username'] = Dever::load("user/lib/info.get#aname", $data['uid']);
+        $data['config_id'] = $account['config_id'];
+        $data['info_id'] = $account['id'];
+        $data['card_id'] = $card_id;
+        $data['name'] = $account['name'] . '充值';
+        $data['cash'] = $cash;
+        $data['price'] = $price;
+        $data['yue'] = $account['cash'] + $cash;
+        $data['pay_channel_id'] = $account['config']['pay_channel_id'];
+        $data['pay_project_id'] = $account['config']['pay_project_id'];
+
+        return Dever::load('account/lib/pay')->create($data);
+    }
+}

+ 22 - 0
src/Withdraw.php

@@ -0,0 +1,22 @@
+<?php
+namespace Account\Src;
+use Dever;
+use User\Lib\Core;
+class Withdraw extends Core
+{
+	# 查看提现数据
+	public function info()
+	{
+		$account = Dever::load('account/lib/info')->getInfo($this->uid, false, 2);
+		return $account;
+	}
+
+    # 提现
+    public function act()
+    {
+    	//Dever::alert('错误', 100);
+    	$account = Dever::load('account/lib/info')->getInfo($this->uid, false, 2);
+    	$cash = Dever::input('cash');
+    	return Dever::load('account/lib/info.up_commit', $this->uid, $cash, 'tixian', $account['config']['key'], '提现');
+    }
+}