Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
stock_new
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
stock_new
Commits
a5d8bd78
Commit
a5d8bd78
authored
Jun 21, 2024
by
twj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
余额提现和期权提现
parent
9fa88147
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
203 deletions
+221
-203
application/apicom/home/Withdraw.php
application/apicom/home/Withdraw.php
+49
-30
application/money/admin/Esopplan.php
application/money/admin/Esopplan.php
+1
-1
application/money/admin/Esopplanrecord.php
application/money/admin/Esopplanrecord.php
+1
-1
application/money/admin/Withdraw.php
application/money/admin/Withdraw.php
+3
-1
application/money/model/EsopPlan.php
application/money/model/EsopPlan.php
+3
-2
application/money/model/Withdraw.php
application/money/model/Withdraw.php
+164
-168
No files found.
application/apicom/home/Withdraw.php
View file @
a5d8bd78
...
@@ -34,20 +34,39 @@ class Withdraw extends Common
...
@@ -34,20 +34,39 @@ class Withdraw extends Common
public
function
index
()
public
function
index
()
{
{
$money
=
\app\money\model\Money
::
getMoney
(
MID
);
$money
=
\app\money\model\Money
::
getMoney
(
MID
);
$money
[
'account'
]
=
bcdiv
(
$money
[
'account'
],
100
,
2
);
$money
[
'account'
]
=
bcdiv
(
$money
[
'account'
],
100
,
2
);
$money
[
'operate_account'
]
=
bcdiv
(
$money
[
'operate_account'
],
100
,
2
);
$money
[
'operate_account'
]
=
bcdiv
(
$money
[
'operate_account'
],
100
,
2
);
$money
[
'operate_account'
]
=
bcdiv
(
$money
[
'operate_account'
],
100
,
2
);
$money
[
'operate_account'
]
=
bcdiv
(
$money
[
'operate_account'
],
100
,
2
);
$banks
=
BankModel
::
getBank
(
MID
);
$banks
=
BankModel
::
getBank
(
MID
);
if
(
empty
(
$banks
))
ajaxmsg
(
'您未绑定银行卡,请先绑定银行卡'
,
0
);
if
(
empty
(
$banks
))
ajaxmsg
(
'您未绑定银行卡,请先绑定银行卡'
,
0
);
$data
[
'money'
]
=
$money
;
$data
[
'money'
]
=
$money
;
$data
[
'banks'
]
=
$banks
;
$data
[
'banks'
]
=
$banks
;
$data
[
'default_bank'
]
=
$banks
[
0
];
$data
[
'default_bank'
]
=
$banks
[
0
];
$data
[
'bankSetting'
]
=
preg_replace
(
'/\|img/'
,
''
,
config
(
"web_bank"
));
$data
[
'bankSetting'
]
=
preg_replace
(
'/\|img/'
,
''
,
config
(
"web_bank"
));
ajaxmsg
(
'线下提现信息'
,
1
,
$data
);
ajaxmsg
(
'线下提现信息'
,
1
,
$data
);
}
/**
* 提现规则说明
*/
public
function
withdrawRule
()
{
//最低提现金额
$minimum
=
config
(
'withdraw_minimum'
);
//最高提现金额
$maximum
=
config
(
'withdraw_maximum'
);
//提现手续费比例
$rate
=
config
(
'withdraw_rate'
);
//提现审核时间
$withdraw_audit_time
=
config
(
'withdraw_audit_time'
);
$rule
=
[];
$rule
[
0
]
=
"1.单笔提现最低金额:"
.
$minimum
;
$rule
[
1
]
=
"2.单笔提现最高金额:"
.
$maximum
;
$rule
[
2
]
=
"3.提现手续费"
.
$rate
.
"%"
;
$rule
[
4
]
=
"4.提现审核时间"
.
$withdraw_audit_time
;
ajaxmsg
(
'提现规则说明'
,
1
,
$rule
);
}
}
/*
/*
* 操作提现操作
* 操作提现操作
...
@@ -58,37 +77,37 @@ class Withdraw extends Common
...
@@ -58,37 +77,37 @@ class Withdraw extends Common
$data
=
$this
->
request
->
post
();
$data
=
$this
->
request
->
post
();
$data
[
'mid'
]
=
MID
;
$data
[
'mid'
]
=
MID
;
$result
=
$this
->
validate
(
$data
,
"Withdraw.create"
);
$result
=
$this
->
validate
(
$data
,
"Withdraw.create"
);
if
(
true
!==
$result
)
{
if
(
true
!==
$result
)
{
ajaxmsg
(
$result
,
0
);
ajaxmsg
(
$result
,
0
);
//$this->error($result);
//$this->error($result);
}
}
if
(
$data
[
'money'
]
<
0
)
{
if
(
$data
[
'money'
]
<
0
)
{
ajaxmsg
(
'提现金额错误!'
,
0
);
ajaxmsg
(
'提现金额错误!'
,
0
);
}
}
$money_res
=
Db
::
name
(
'money'
)
->
where
([
'mid'
=>
MID
])
->
find
();
$money_res
=
Db
::
name
(
'money'
)
->
where
([
'mid'
=>
MID
])
->
find
();
if
(
empty
(
$money_res
[
'account'
]))
{
if
(
empty
(
$money_res
[
'account'
]))
{
ajaxmsg
(
'查询账户资金出错!'
,
0
);
ajaxmsg
(
'查询账户资金出错!'
,
0
);
}
}
if
(
isset
(
$money_res
[
'account'
])
&&
$money_res
[
'account'
]
<
$data
[
'money'
])
{
if
(
isset
(
$money_res
[
'account'
])
&&
$money_res
[
'account'
]
<
$data
[
'money'
])
{
ajaxmsg
(
'提现金额已经大于可用余额!'
,
0
);
ajaxmsg
(
'提现金额已经大于可用余额!'
,
0
);
}
}
$withdraw_info
=
Db
::
name
(
'money_withdraw'
)
$withdraw_info
=
Db
::
name
(
'money_withdraw'
)
->
where
([
'mid'
=>
MID
])
->
where
([
'mid'
=>
MID
])
->
where
([
'status'
=>
0
])
->
where
([
'status'
=>
0
])
->
find
();
->
find
();
if
(
!
empty
(
$withdraw_info
))
{
if
(
!
empty
(
$withdraw_info
))
{
ajaxmsg
(
'您已有提现申请,请耐心等待审核。'
,
0
);
ajaxmsg
(
'您已有提现申请,请耐心等待审核。'
,
0
);
}
}
$c
=
Db
::
name
(
'member'
)
->
where
([
"id"
=>
MID
])
->
find
();
$c
=
Db
::
name
(
'member'
)
->
where
([
"id"
=>
MID
])
->
find
();
if
(
Hash
::
check
((
string
)
$data
[
'paywd'
],
$c
[
'paywd'
]))
{
if
(
Hash
::
check
((
string
)
$data
[
'paywd'
],
$c
[
'paywd'
]))
{
$res
=
WithdrawModel
::
saveData
(
$data
);
$res
=
WithdrawModel
::
saveData
(
$data
);
}
else
{
}
else
{
ajaxmsg
(
'支付密码错误'
,
0
);
ajaxmsg
(
'支付密码错误'
,
0
);
}
}
if
(
$res
[
'status'
])
{
if
(
$res
[
'status'
])
{
ajaxmsg
(
'提现申请已提交,请耐心等待审核'
,
1
);
ajaxmsg
(
'提现申请已提交,请耐心等待审核'
,
1
);
}
else
{
}
else
{
ajaxmsg
(
'提现申请提交失败'
,
0
);
ajaxmsg
(
'提现申请提交失败'
,
0
);
}
}
}
}
}
}
\ No newline at end of file
application/money/admin/Esopplan.php
View file @
a5d8bd78
...
@@ -83,7 +83,7 @@ class Esopplan extends Admin
...
@@ -83,7 +83,7 @@ class Esopplan extends Admin
$data
[
'create_time'
]
=
time
();
$data
[
'create_time'
]
=
time
();
$data
[
'plan_account'
]
=
$data
[
'plan_account'
]
*
100
;
$data
[
'plan_account'
]
=
$data
[
'plan_account'
]
*
100
;
$data
[
'remain_account'
]
=
$data
[
'plan_account'
]
*
100
;
$data
[
'remain_account'
]
=
$data
[
'plan_account'
]
*
100
;
$data
[
'create_ip'
]
=
get_client_ip
(
1
);
$data
[
'create_ip'
]
=
get_client_ip
(
0
);
//业务逻辑处理
//业务逻辑处理
$result_up
=
Db
::
name
(
"esop_plan"
)
->
insert
(
$data
);
$result_up
=
Db
::
name
(
"esop_plan"
)
->
insert
(
$data
);
if
(
$result_up
===
1
)
{
if
(
$result_up
===
1
)
{
...
...
application/money/admin/Esopplanrecord.php
View file @
a5d8bd78
...
@@ -112,7 +112,7 @@ class EsopplanRecord extends Admin
...
@@ -112,7 +112,7 @@ class EsopplanRecord extends Admin
'type'
=>
1
,
'type'
=>
1
,
'info'
=>
"自动行权,期权增加"
.
(
$affect
/
100
),
'info'
=>
"自动行权,期权增加"
.
(
$affect
/
100
),
'create_time'
=>
time
(),
'create_time'
=>
time
(),
'create_ip'
=>
get_client_ip
(
1
)
'create_ip'
=>
get_client_ip
(
0
)
];
];
EsopPlanRecordModel
::
create
(
$arr
);
EsopPlanRecordModel
::
create
(
$arr
);
}
}
...
...
application/money/admin/Withdraw.php
View file @
a5d8bd78
...
@@ -67,7 +67,9 @@ class Withdraw extends Admin
...
@@ -67,7 +67,9 @@ class Withdraw extends Admin
[
'order_no'
,
'订单号'
],
[
'order_no'
,
'订单号'
],
[
'mobile'
,
'手机号'
],
[
'mobile'
,
'手机号'
],
[
'name'
,
'姓名'
],
[
'name'
,
'姓名'
],
[
'money'
,
'金额'
],
[
'money'
,
'申请金额'
],
[
'fee'
,
'手续费'
],
[
'real_money'
,
'到账金额'
],
[
'bank'
,
'银行信息'
],
[
'bank'
,
'银行信息'
],
[
'status'
,
'状态'
],
[
'status'
,
'状态'
],
[
'create_time'
,
'申请时间'
,
'datetime'
],
[
'create_time'
,
'申请时间'
,
'datetime'
],
...
...
application/money/model/EsopPlan.php
View file @
a5d8bd78
...
@@ -66,9 +66,10 @@ class EsopPlan extends Model
...
@@ -66,9 +66,10 @@ class EsopPlan extends Model
$data
[
'bank'
]
=
$bank
[
'bank'
]
.
"|"
.
$bank
[
'card'
]
.
'|'
.
$bank
[
'province'
]
.
$bank
[
'city'
]
.
$bank
[
'branch'
]
.
"|"
.
$names
[
'name'
];
$data
[
'bank'
]
=
$bank
[
'bank'
]
.
"|"
.
$bank
[
'card'
]
.
'|'
.
$bank
[
'province'
]
.
$bank
[
'city'
]
.
$bank
[
'branch'
]
.
"|"
.
$names
[
'name'
];
$data
[
'mid'
]
=
$parameter
[
'mid'
];
$data
[
'mid'
]
=
$parameter
[
'mid'
];
$data
[
'money'
]
=
$parameter
[
'money'
]
*
100
;
$data
[
'money'
]
=
$parameter
[
'money'
]
*
100
;
$data
[
'fee'
]
=
$parameter
[
'money'
]
*
100
*
config
(
'withdraw_rate'
);
$data
[
'order_no'
]
=
'tx'
.
generate_rand_str
(
10
,
3
);
$data
[
'order_no'
]
=
'tx'
.
generate_rand_str
(
10
,
3
);
$data
[
'create_time'
]
=
time
();
$data
[
'create_time'
]
=
time
();
$data
[
'create_ip'
]
=
get_client_ip
(
1
);
$data
[
'create_ip'
]
=
get_client_ip
(
0
);
Db
::
startTrans
();
Db
::
startTrans
();
//查看当前期权的信息
//查看当前期权的信息
...
@@ -89,7 +90,7 @@ class EsopPlan extends Model
...
@@ -89,7 +90,7 @@ class EsopPlan extends Model
'type'
=>
3
,
'type'
=>
3
,
'info'
=>
"期权申请提现,金额:"
.
$parameter
[
'money'
],
'info'
=>
"期权申请提现,金额:"
.
$parameter
[
'money'
],
'create_time'
=>
time
(),
'create_time'
=>
time
(),
'create_ip'
=>
get_client_ip
(
1
)
'create_ip'
=>
get_client_ip
(
0
)
];
];
$res2
=
EsopPlanRecordModel
::
create
(
$arr
);
$res2
=
EsopPlanRecordModel
::
create
(
$arr
);
//更新期权信息
//更新期权信息
...
...
application/money/model/Withdraw.php
View file @
a5d8bd78
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment