|
@@ -50,7 +50,7 @@ class Info
|
|
|
if ($result) {
|
|
if ($result) {
|
|
|
$type = Dever::db('account/config_type')->getData();
|
|
$type = Dever::db('account/config_type')->getData();
|
|
|
foreach ($result as $k => $v) {
|
|
foreach ($result as $k => $v) {
|
|
|
- $result[$k]['cdate'] = date('Y-m-d H:i:s', $v['cdate']);
|
|
|
|
|
|
|
+ $result[$k]['cdate'] = date('Y-m-d H:i', $v['cdate']);
|
|
|
if (isset($type[$v['type_id']])) {
|
|
if (isset($type[$v['type_id']])) {
|
|
|
$result[$k]['type_name'] = $type[$v['type_id']]['name'];
|
|
$result[$k]['type_name'] = $type[$v['type_id']]['name'];
|
|
|
} else {
|
|
} else {
|
|
@@ -127,7 +127,7 @@ class Info
|
|
|
if ($type['project_id'] != -1 && $type['project_id'] != $config['project_id']) {
|
|
if ($type['project_id'] != -1 && $type['project_id'] != $config['project_id']) {
|
|
|
return $this->alert('交易类型不正确', $state);
|
|
return $this->alert('交易类型不正确', $state);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ $data['status'] = 2;
|
|
|
$data['uid'] = $uid;
|
|
$data['uid'] = $uid;
|
|
|
$data['config_id'] = $config['id'];
|
|
$data['config_id'] = $config['id'];
|
|
|
$data['project_id'] = $config['project_id'];
|
|
$data['project_id'] = $config['project_id'];
|
|
@@ -141,6 +141,18 @@ class Info
|
|
|
$info['cash'] = 0;
|
|
$info['cash'] = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $func = 'inc';
|
|
|
|
|
+ if ($type['type'] == 2) {
|
|
|
|
|
+ if ($info['cash'] < $cash) {
|
|
|
|
|
+ return $this->alert('账户余额不足', $state);
|
|
|
|
|
+ }
|
|
|
|
|
+ $cash = -1*$cash;
|
|
|
|
|
+ $func = 'dec';
|
|
|
|
|
+ }
|
|
|
|
|
+ $data['info_id'] = $info['id'];
|
|
|
|
|
+ $data['ycash'] = $cash;
|
|
|
|
|
+ $data['cash'] = $cash;
|
|
|
|
|
+
|
|
|
if ($type['key'] == 'tixian') {
|
|
if ($type['key'] == 'tixian') {
|
|
|
if ($config['is_withdraw'] == 2) {
|
|
if ($config['is_withdraw'] == 2) {
|
|
|
return $this->alert('当前账户不能提现', $state);
|
|
return $this->alert('当前账户不能提现', $state);
|
|
@@ -154,18 +166,22 @@ class Info
|
|
|
if ($cash > $info['cash']) {
|
|
if ($cash > $info['cash']) {
|
|
|
return $this->alert('提现金额不能大于账户余额', $state);
|
|
return $this->alert('提现金额不能大于账户余额', $state);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $func = 'inc';
|
|
|
|
|
- if ($type['type'] == 2) {
|
|
|
|
|
- if ($info['cash'] < $cash) {
|
|
|
|
|
- return $this->alert('账户余额不足', $state);
|
|
|
|
|
|
|
+ if ($config['withdraw_check']) {
|
|
|
|
|
+ $msg = Dever::load($config['withdraw_check'], $uid, $cash);
|
|
|
|
|
+ if ($msg != 'ok') {
|
|
|
|
|
+ return $this->alert($msg, $state);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($config['withdraw_audit'] == 1) {
|
|
|
|
|
+ $data['status'] = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($config['withdraw_fee']) {
|
|
|
|
|
+ $fee = Dever::per($cash, $config['withdraw_fee']);
|
|
|
|
|
+ $data['cash'] -= $fee;
|
|
|
}
|
|
}
|
|
|
- $cash = -1*$cash;
|
|
|
|
|
- $func = 'dec';
|
|
|
|
|
}
|
|
}
|
|
|
- $data['info_id'] = $info['id'];
|
|
|
|
|
- $data['cash'] = $cash;
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
$data['type_id'] = $type['id'];
|
|
$data['type_id'] = $type['id'];
|
|
|
|
|
|
|
|
if ($source) {
|
|
if ($source) {
|
|
@@ -191,12 +207,16 @@ class Info
|
|
|
|
|
|
|
|
$yue = $data['yue'];
|
|
$yue = $data['yue'];
|
|
|
$data['method'] = $method;
|
|
$data['method'] = $method;
|
|
|
- $admin = Dever::load('manage/auth.data');
|
|
|
|
|
- if ($admin) {
|
|
|
|
|
- $data['admin_id'] = $admin['id'];
|
|
|
|
|
|
|
+ if ($data['status'] == 2) {
|
|
|
|
|
+ $admin = Dever::load('manage/auth.data');
|
|
|
|
|
+ if ($admin) {
|
|
|
|
|
+ $data['audit_admin'] = $admin['id'];
|
|
|
|
|
+ }
|
|
|
|
|
+ $data['audit_date'] = time();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$data['clear'] = true;
|
|
$data['clear'] = true;
|
|
|
|
|
+
|
|
|
$id = Dever::db('account/info_log')->insert($data);
|
|
$id = Dever::db('account/info_log')->insert($data);
|
|
|
if ($id) {
|
|
if ($id) {
|
|
|
$update = array();
|
|
$update = array();
|