Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
P
Project_Laravel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Nguyen Huu Huan
Project_Laravel
Commits
5f2ed7da
Commit
5f2ed7da
authored
Sep 22, 2022
by
20194288-huannh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cho phép lọc theo danh sách key cụ thể
parent
f39ee5a5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
OrderController.php
app/Http/Controllers/Api/OrderController.php
+3
-3
OrderController.php
app/Http/Controllers/OrderController.php
+2
-2
GetOrderRequest.php
app/Http/Requests/GetOrderRequest.php
+1
-1
No files found.
app/Http/Controllers/Api/OrderController.php
View file @
5f2ed7da
...
...
@@ -24,10 +24,10 @@ public function __construct(OrderRepository $orderRepository)
}
public
function
index
(
GetOrderRequest
$request
)
{
$user
=
auth
(
'api'
)
->
user
();
$user
=
auth
()
->
user
();
$order
=
$user
->
role
==
User
::
ROLE_ADMIN
?
$this
->
orderRepository
->
getListOrder
(
$request
->
all
(
))
:
$this
->
orderRepository
->
getListOrder
(
$request
->
all
(
),
$user
->
id
);
$this
->
orderRepository
->
getListOrder
(
$request
->
only
([
'keyword'
,
'status'
]
))
:
$this
->
orderRepository
->
getListOrder
(
$request
->
only
([
'keyword'
,
'status'
]
),
$user
->
id
);
return
response
()
->
json
([
'success'
=>
true
,
'meta'
=>
[
...
...
app/Http/Controllers/OrderController.php
View file @
5f2ed7da
...
...
@@ -25,8 +25,8 @@ public function index(GetOrderRequest $request)
{
$user
=
auth
(
'api'
)
->
user
();
$order
=
$user
->
role
==
User
::
ROLE_ADMIN
?
$this
->
orderRepository
->
getListOrder
(
$request
->
all
(
))
:
$this
->
orderRepository
->
getListOrder
(
$request
->
all
(
),
$user
->
id
);
$this
->
orderRepository
->
getListOrder
(
$request
->
only
([
'status'
,
'keyword'
]
))
:
$this
->
orderRepository
->
getListOrder
(
$request
->
only
([
'status'
,
'keyword'
]
),
$user
->
id
);
return
response
()
->
json
([
'success'
=>
true
,
'meta'
=>
[
...
...
app/Http/Requests/GetOrderRequest.php
View file @
5f2ed7da
...
...
@@ -25,7 +25,7 @@ public function rules()
{
return
[
'status'
=>
'integer'
,
'keyword'
=>
'max:255'
'keyword'
=>
'
string|
max:255'
];
}
}
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