Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
775a3c7b
Commit
775a3c7b
authored
Sep 27, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户查询
parent
ed97fd8a
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
427 additions
and
16 deletions
+427
-16
UserServiceContract.php
app/Contracts/UserServiceContract.php
+2
-0
UserController.php
app/Http/Controllers/UserController.php
+17
-3
UserService.php
app/Services/UserService.php
+12
-1
dashboard.blade.php
resources/views/admin/dashboard.blade.php
+3
-3
footer.blade.php
resources/views/admin/footer.blade.php
+0
-0
header.blade.php
resources/views/admin/header.blade.php
+0
-0
sidebar.blade.php
resources/views/admin/sidebar.blade.php
+3
-3
test.blade.php
resources/views/admin/test.blade.php
+1
-1
userinformation.blade.php
resources/views/admin/userinformation.blade.php
+378
-0
usertables.blade.php
resources/views/admin/usertables.blade.php
+3
-2
web.php
routes/web.php
+8
-3
No files found.
app/Contracts/UserServiceContract.php
View file @
775a3c7b
...
@@ -12,4 +12,6 @@ namespace App\Contracts;
...
@@ -12,4 +12,6 @@ namespace App\Contracts;
interface
UserServiceContract
interface
UserServiceContract
{
{
public
function
getAll
();
public
function
getAll
();
public
function
get
(
$id
);
}
}
\ No newline at end of file
app/Http/Controllers/
Test
Controller.php
→
app/Http/Controllers/
User
Controller.php
View file @
775a3c7b
...
@@ -6,7 +6,7 @@ use App\Contracts\UserServiceContract;
...
@@ -6,7 +6,7 @@ use App\Contracts\UserServiceContract;
use
App\Util\Message
;
use
App\Util\Message
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
class
Test
Controller
extends
Controller
class
User
Controller
extends
Controller
{
{
public
$mUser
;
public
$mUser
;
...
@@ -16,14 +16,28 @@ class TestController extends Controller
...
@@ -16,14 +16,28 @@ class TestController extends Controller
$this
->
mUser
=
$user
;
$this
->
mUser
=
$user
;
}
}
public
function
getAll
()
public
function
getAll
()
{
{
$result
=
$this
->
mUser
->
getAll
();
$result
=
$this
->
mUser
->
getAll
();
if
(
$result
){
if
(
$result
){
return
view
(
'
Admin-lte/UserT
ables'
,
compact
(
'result'
));
return
view
(
'
admin/usert
ables'
,
compact
(
'result'
));
}
else
{
}
else
{
return
Message
::
makeError
(
'获取失败'
);
return
Message
::
makeError
(
'获取失败'
);
}
}
}
}
public
function
get
(
$id
)
{
$result
=
$this
->
mUser
->
get
(
$id
);
if
(
$result
){
return
view
(
'admin/userinformation'
,
compact
(
'result'
));
}
else
{
return
Message
::
makeError
(
'无次用户'
);
}
}
}
}
app/Services/UserService.php
View file @
775a3c7b
...
@@ -16,10 +16,21 @@ class UserService implements UserServiceContract
...
@@ -16,10 +16,21 @@ class UserService implements UserServiceContract
{
{
public
function
getAll
()
public
function
getAll
()
{
{
$users
=
User
::
all
(
);
$users
=
User
::
paginate
(
2
);
if
(
count
(
$users
)
<
0
){
if
(
count
(
$users
)
<
0
){
return
null
;
return
null
;
}
}
return
$users
;
return
$users
;
}
}
public
function
get
(
$id
)
{
$user
=
User
::
find
(
$id
);
if
(
$user
==
null
){
return
null
;
}
else
{
return
$user
;
}
}
}
}
\ No newline at end of file
resources/views/
Admin-lte
/dashboard.blade.php
→
resources/views/
admin
/dashboard.blade.php
View file @
775a3c7b
...
@@ -56,12 +56,12 @@ desired effect
...
@@ -56,12 +56,12 @@ desired effect
<body
class=
"hold-transition skin-blue sidebar-mini"
>
<body
class=
"hold-transition skin-blue sidebar-mini"
>
<div
class=
"wrapper"
>
<div
class=
"wrapper"
>
@include('
Admin-lte
/header')
@include('
admin
/header')
{{--Sidebar--}}
{{--Sidebar--}}
@include('
Admin-lte
/sidebar')
@include('
admin
/sidebar')
<!-- Content Wrapper. Contains page content -->
<!-- Content Wrapper. Contains page content -->
...
@@ -89,7 +89,7 @@ desired effect
...
@@ -89,7 +89,7 @@ desired effect
<!-- /.content-wrapper -->
<!-- /.content-wrapper -->
@include('
Admin-lte
/footer')
@include('
admin
/footer')
<!-- Control Sidebar -->
<!-- Control Sidebar -->
...
...
resources/views/
Admin-lte
/footer.blade.php
→
resources/views/
admin
/footer.blade.php
View file @
775a3c7b
File moved
resources/views/
Admin-lte
/header.blade.php
→
resources/views/
admin
/header.blade.php
View file @
775a3c7b
File moved
resources/views/
Admin-lte
/sidebar.blade.php
→
resources/views/
admin
/sidebar.blade.php
View file @
775a3c7b
...
@@ -34,16 +34,16 @@
...
@@ -34,16 +34,16 @@
<ul
class=
"sidebar-menu"
>
<ul
class=
"sidebar-menu"
>
<li
class=
"header"
>
HEADER
</li>
<li
class=
"header"
>
HEADER
</li>
<!-- Optionally, you can add icons to the links -->
<!-- Optionally, you can add icons to the links -->
<li
class=
"active"
><a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
用户列表
</span></a></li>
<li
class=
"active"
><a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
admin-index
</span></a></li>
<li
class=
"treeview"
>
<li
class=
"treeview"
>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
Multilevel
</span>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
用户管理
</span>
<span
class=
"pull-right-container"
>
<span
class=
"pull-right-container"
>
<i
class=
"fa fa-angle-left pull-right"
></i>
<i
class=
"fa fa-angle-left pull-right"
></i>
</span>
</span>
</a>
</a>
<ul
class=
"treeview-menu"
>
<ul
class=
"treeview-menu"
>
<li><a
href=
"
#"
>
Link in level 2
</a></li>
<li><a
href=
"
{{url('user/getAll')}}"
>
用户列表
</a></li>
<li><a
href=
"#"
>
Link in level 2
</a></li>
<li><a
href=
"#"
>
Link in level 2
</a></li>
</ul>
</ul>
</li>
</li>
...
...
resources/views/
Admin-lte
/test.blade.php
→
resources/views/
admin
/test.blade.php
View file @
775a3c7b
@
extends
(
'
Admin-lte
/dashboard'
)
@
extends
(
'
admin
/dashboard'
)
@
section
(
'content'
)
@
section
(
'content'
)
<
div
class
=
'row'
>
<
div
class
=
'row'
>
<
div
class
=
'col-md-6'
>
<
div
class
=
'col-md-6'
>
...
...
resources/views/admin/userinformation.blade.php
0 → 100644
View file @
775a3c7b
This diff is collapsed.
Click to expand it.
resources/views/
Admin-lte/UserT
ables.blade.php
→
resources/views/
admin/usert
ables.blade.php
View file @
775a3c7b
@
extends
(
'
Admin-lte
/dashboard'
)
@
extends
(
'
admin
/dashboard'
)
@
section
(
'content'
)
@
section
(
'content'
)
...
@@ -50,13 +50,14 @@
...
@@ -50,13 +50,14 @@
<
td
>
{{
$value
[
'gender'
]
==
0
?
'男'
:
'女'
}}
</
td
>
<
td
>
{{
$value
[
'gender'
]
==
0
?
'男'
:
'女'
}}
</
td
>
<
td
>
{{
$value
[
'eamil'
]}}
</
td
>
<
td
>
{{
$value
[
'eamil'
]}}
</
td
>
<
td
>
{{
$value
[
'status'
]}}
</
td
>
<
td
>
{{
$value
[
'status'
]}}
</
td
>
<
td
>
<
button
>
拉黑
</
button
></
td
>
<
td
>
<
a
href
=
"
{
{url('user/get')}}/{{$value['id']}
}
"
class
=
"btn btn-info"
>
查看详情
</
a
></
td
>
</
tr
>
</
tr
>
</
tbody
>
</
tbody
>
@
endforeach
@
endforeach
</
table
>
</
table
>
{{
$result
->
links
()
}}
</
div
>
</
div
>
<!--
/.
box
-
body
-->
<!--
/.
box
-
body
-->
</
div
>
</
div
>
...
...
routes/web.php
View file @
775a3c7b
...
@@ -36,13 +36,18 @@ Route::get('/home', 'HomeController@index')->name('home');
...
@@ -36,13 +36,18 @@ Route::get('/home', 'HomeController@index')->name('home');
// 获取所有用户
// 用户
Route
::
get
(
'getAll'
,
'TestController@getAll'
);
Route
::
group
([
'prefix'
=>
'user'
],
function
(){
Route
::
get
(
'getAll'
,
'UserController@getAll'
)
->
name
(
'user.getAll'
);
Route
::
get
(
'get/{id}'
,
'UserController@get'
)
->
name
(
'user.get'
);
});
Route
::
get
(
'table'
,
function
(){
Route
::
get
(
'table'
,
function
(){
return
view
(
'
Admin-lte/UserT
ables'
);
return
view
(
'
admin/usert
ables'
);
});
});
...
...
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