Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_server_welfare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4b160bdc
authored
Oct 10, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
审核接入兑现任务
parent
187e0248
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
15 deletions
app/Http/Controllers/UserExchangesController.php
app/Models/UserExchange.php
storage/laravels.json
storage/laravels.pid
app/Http/Controllers/UserExchangesController.php
View file @
4b160bdc
...
...
@@ -74,11 +74,10 @@ class UserExchangesController extends Controller
'audit_time'
=>
time
(),
'update_time'
=>
time
(),
'audit_id'
=>
$request
->
get
(
'audit_id'
),
'user_id'
=>
$request
->
get
(
'user_id'
),
'audit_email'
=>
$request
->
get
(
'audit_email'
),
'status'
=>
$request
->
get
(
'status'
),
];
$res
=
$userExchange
->
auditUserExchange
(
$request
->
id
,
$
request
->
exchange_amount
,
$
data
);
$res
=
$userExchange
->
auditUserExchange
(
$request
->
id
,
$data
);
if
(
$res
)
{
return
$this
->
Export
(
0
,
'ok'
);
}
else
{
...
...
app/Models/UserExchange.php
View file @
4b160bdc
...
...
@@ -73,19 +73,15 @@ class UserExchange extends Model
//审核用户的兑换
public
function
auditUserExchange
(
$id
,
$
exchangedAmount
,
$
data
=
[])
public
function
auditUserExchange
(
$id
,
$data
=
[])
{
$result
=
DB
::
transaction
(
function
()
use
(
$id
,
$exchangedAmount
,
$data
)
{
$result
=
DB
::
transaction
(
function
()
use
(
$id
,
$data
)
{
//根据id获取userExchange信息
$exchange
=
DB
::
table
(
'user_exchanges'
)
->
where
(
'id'
,
$id
)
->
first
();
$exchange
=
(
array
)
$exchange
;
//如果是通过的操作,则直接调用ExchangeTask,否则自己写数据库改变状态
if
(
$data
[
'status'
]
==
1
)
{
$exchange
[
'amount'
]
=
$exchangedAmount
;
if
(
$exchangedAmount
>
100
)
{
Log
::
Error
(
'出现大于100的兑换申请!'
);
return
false
;
}
$data
[
'id'
]
=
$id
;
$task
=
new
ExchangesTask
(
$data
,
$exchange
,
$data
[
'audit_id'
]);
if
(
$data
[
'status'
]
==
1
&&
$exchange
[
'amount'
]
<=
200
)
{
$task
=
new
ExchangesTask
(
$exchange
,
$exchange
,
$data
[
'audit_id'
]);
$result
=
Task
::
deliver
(
$task
);
if
(
!
$result
)
{
Log
::
error
(
'后台审核任务失败'
);
...
...
@@ -97,6 +93,7 @@ class UserExchange extends Model
if
(
!
$result
)
{
return
false
;
}
else
{
return
true
;
}
}
//无论是审核通过还是拒绝都要去通知用户
...
...
storage/laravels.json
View file @
4b160bdc
This diff is collapsed.
Click to expand it.
storage/laravels.pid
View file @
4b160bdc
23271
\ No newline at end of file
23592
\ No newline at end of file
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