切换导航条
此项目
正在载入...
登录
root
/
sleep
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
bde37606a7850fcee1662a4711b8c4c20a30bd32
1 个父辈
40715032
1 个管道 的构建
通过
耗费 7 秒
XIAOPAN
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
19 行增加
和
15 行删除
app/portal/controller/UsersController.php
app/portal/controller/UsersController.php
查看文件 @
bde3760
...
...
@@ -542,6 +542,21 @@ class UsersController extends HomeBaseController{
if
(
$user
[
'fee'
]
>=
$fee
)
{
//生成订单号
$order_sn
=
cmf_get_order_sn
();
Db
::
startTrans
();
try
{
Db
::
name
(
'users'
)
->
where
(
'id'
,
$user_id
)
->
setDec
(
'fee'
,
$fee
);
Db
::
name
(
'withdraw'
)
->
insert
([
'user_id'
=>
$user_id
,
'money'
=>
$fee
,
'create_time'
=>
time
(),
'order_sn'
=>
$order_sn
]);
Db
::
commit
();
}
catch
(
\Exception
$e
)
{
// 回滚事务
Db
::
rollback
();
$this
->
apiResponse
(
301
,
'提现失败'
);
}
//进行提现
$app
=
new
Application
(
$this
->
options
);
$merchantPay
=
$app
->
merchant_pay
;
...
...
@@ -557,23 +572,12 @@ class UsersController extends HomeBaseController{
];
$re
=
$merchantPay
->
send
(
$merchantPayData
);
if
(
$re
[
'return_code'
]
==
'SUCCESS'
&&
$re
[
'result_code'
]
==
'SUCCESS'
){
Db
::
startTrans
();
try
{
Db
::
name
(
'users'
)
->
where
(
'id'
,
$user_id
)
->
setDec
(
'fee'
,
$fee
);
Db
::
name
(
'withdraw'
)
->
insert
([
'user_id'
=>
$user_id
,
'money'
=>
$fee
,
'create_time'
=>
time
(),
'order_sn'
=>
$order_sn
]);
Db
::
commit
();
}
catch
(
\Exception
$e
)
{
// 回滚事务
Db
::
rollback
();
$this
->
apiResponse
(
301
,
'提现失败'
);
}
$this
->
apiResponse
(
200
,
'success'
);
}
else
{
Db
::
name
(
'users'
)
->
where
(
'id'
,
$user_id
)
->
setInc
(
'fee'
,
$fee
);
Db
::
name
(
'withdraw'
)
->
where
([
'order_sn'
=>
$order_sn
])
->
delete
();
$this
->
apiResponse
(
301
,
'提现失败'
);
}
}
else
{
...
...
请
注册
或
登录
后发表评论