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
12724897
authored
Sep 03, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改show方法支持传入user_id
parent
e67797b3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
app/Http/Controllers/UserExchangesController.php
app/Http/Controllers/UserExchangesController.php
View file @
12724897
...
...
@@ -27,8 +27,18 @@ class UserExchangesController extends Controller
*/
public
function
show
(
Request
$request
)
{
$id
=
$request
->
id
;
$userExchange
=
UserExchange
::
with
(
'exchange_setting'
)
->
where
(
'id'
,
$id
)
->
first
()
->
toArray
();
//判断是根据user_id还是主键id获取
$userExchange
=
[];
if
(
$id
=
$request
->
get
(
'id'
))
{
$map
=
[[
'id'
,
'='
,
$id
]];
$userExchange
=
UserExchange
::
with
(
'exchange_setting'
)
->
where
(
$map
)
->
first
()
->
toArray
();
}
elseif
(
$userId
=
$request
->
get
(
'user_id'
))
{
$map
=
[[
'user_id'
,
'='
,
$userId
]];
$userExchange
=
UserExchange
::
with
(
'exchange_setting'
)
->
where
(
$map
)
->
orderBy
(
'id'
,
'desc'
)
->
first
()
->
toArray
();
}
return
$this
->
Export
(
0
,
'ok'
,
[
'data'
=>
$userExchange
]);
}
...
...
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