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
28e8d641
Commit
28e8d641
authored
Sep 29, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
团队管理模块
parent
1c8ced77
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
193 additions
and
103 deletions
+193
-103
GroupServiceContract.php
app/Contracts/GroupServiceContract.php
+1
-0
GroupController.php
app/Http/Controllers/GroupController.php
+70
-12
GroupService.php
app/Services/GroupService.php
+13
-0
footer.blade.php
resources/views/admin/footer.blade.php
+2
-2
groupinformation.blade.php
resources/views/admin/group/groupinformation.blade.php
+1
-1
grouptables.blade.php
resources/views/admin/group/grouptables.blade.php
+7
-7
transfer.blade.php
resources/views/admin/group/transfer.blade.php
+65
-40
update.blade.php
resources/views/admin/group/update.blade.php
+2
-2
sidebar.blade.php
resources/views/admin/sidebar.blade.php
+17
-3
update.blade.php
resources/views/admin/user/update.blade.php
+1
-1
userinformation.blade.php
resources/views/admin/userinformation.blade.php
+1
-1
usertables.blade.php
resources/views/admin/usertables.blade.php
+4
-26
web.php
routes/web.php
+9
-8
No files found.
app/Contracts/GroupServiceContract.php
View file @
28e8d641
...
...
@@ -19,6 +19,7 @@ interface GroupServiceContract
public
function
getAll
(
$page
);
public
function
ajax
(
$name
);
public
function
simpleSearch
(
$search_content
,
$page
);
}
\ No newline at end of file
app/Http/Controllers/GroupController.php
View file @
28e8d641
...
...
@@ -44,12 +44,26 @@ class GroupController extends Controller
public
function
updatePage
(
Request
$request
)
{
$id
=
$request
->
id
;
$group
=
$this
->
mGroup
->
get
(
$id
);
if
(
count
(
$group
)
>
0
){
return
view
(
'admin/group/update'
,
compact
(
'group'
));
$rules
=
[
'id'
=>
'required'
,
];
$validator
=
Validator
::
make
(
$request
->
all
(),
$rules
);
if
(
$validator
->
fails
()){
return
Message
::
makeError
(
"invalid param"
,
$validator
->
messages
()
->
messages
());
}
else
{
$id
=
$request
->
id
;
$group
=
$this
->
mGroup
->
get
(
$id
);
if
(
count
(
$group
)
>
0
){
return
view
(
'admin/group/update'
,
compact
(
'group'
));
}
return
Message
::
makeError
(
'查找失败'
);
}
return
Message
::
makeError
(
'查找失败'
);
}
...
...
@@ -59,6 +73,7 @@ class GroupController extends Controller
$rules
=
[
'name'
=>
'required'
,
'id'
=>
'required'
,
];
$validator
=
Validator
::
make
(
$request
->
all
(),
$rules
);
...
...
@@ -74,7 +89,6 @@ class GroupController extends Controller
$logo
=
null
;
}
$result
=
$this
->
mGroup
->
update
(
$id
,
$name
,
$logo
,
$brief
,
$status
);
if
(
$result
){
return
redirect
(
route
(
'group.getAll'
));
}
else
{
...
...
@@ -87,18 +101,51 @@ class GroupController extends Controller
public
function
transferPage
(
Request
$request
)
{
$id
=
$request
->
id
;
$group
=
$this
->
mGroup
->
get
(
$id
);
if
(
count
(
$group
)
>
0
){
return
view
(
'admin/group/transfer'
,
compact
(
'group'
));
$rules
=
[
'id'
=>
'required'
,
];
$validator
=
Validator
::
make
(
$request
->
all
(),
$rules
);
if
(
$validator
->
fails
()){
return
Message
::
makeError
(
"invalid param"
,
$validator
->
messages
()
->
messages
());
}
else
{
$id
=
$request
->
id
;
$group
=
$this
->
mGroup
->
get
(
$id
);
if
(
count
(
$group
)
>
0
){
return
view
(
'admin/group/transfer'
,
compact
(
'group'
));
}
return
Message
::
makeError
(
'获取失败请重试!'
);
}
return
Message
::
makeError
(
'获取失败请重试!'
);
}
public
function
transfer
(
Request
$request
)
{
$result
=
$this
->
mGroup
->
transfer
();
$rules
=
[
'id'
=>
'required'
,
'new_owner_id'
,
];
$validator
=
Validator
::
make
(
$request
->
all
(),
$rules
);
if
(
$validator
->
fails
()){
return
Message
::
makeError
(
"invalid param"
,
$validator
->
messages
()
->
messages
());
}
else
{
$id
=
$request
->
id
;
$newOwnerId
=
$request
->
new_owner_id
;
$result
=
$this
->
mGroup
->
transfer
(
$id
,
$newOwnerId
);
if
(
$result
){
return
redirect
(
route
(
'group.getAll'
));
}
else
{
return
Message
::
makeError
(
'修改失败'
);
}
}
}
...
...
@@ -110,4 +157,15 @@ class GroupController extends Controller
}
return
null
;
}
public
function
simpleSearch
(
Request
$request
)
{
$search_content
=
$request
->
search
;
$page
=
1
;
$groups
=
$this
->
mGroup
->
simpleSearch
(
$search_content
,
$page
);
return
view
(
'admin/group/grouptables'
,
compact
(
'groups'
));
}
}
app/Services/GroupService.php
View file @
28e8d641
...
...
@@ -120,4 +120,17 @@ class GroupService implements GroupServiceContract
}
return
null
;
}
public
function
simpleSearch
(
$search_content
,
$page
)
{
$group
=
Group
::
where
(
'name'
,
'like'
,
'%'
.
$search_content
.
'%'
)
->
paginate
(
$page
);
if
(
count
(
$group
)
>
0
){
return
$group
;
}
$result
=
null
;
return
$result
;
}
}
\ No newline at end of file
resources/views/admin/footer.blade.php
View file @
28e8d641
...
...
@@ -2,8 +2,8 @@
<footer
class=
"main-footer"
>
<!-- To the right -->
<div
class=
"pull-right hidden-xs"
>
Anything you want
{{--Anything you want--}}
</div>
<!-- Default to the left -->
<strong>
Copyright
©
2016
<a
href=
"#"
>
Company
</a>
.
</strong>
All rights reserved.
{{--
<strong>
Copyright
©
2016
<a
href=
"#"
>
Company
</a>
.
</strong>
All rights reserved.--}}
</footer>
resources/views/admin/group/groupinformation.blade.php
View file @
28e8d641
...
...
@@ -3,7 +3,7 @@
<
section
class
=
"content-header"
>
<
h1
>
User
Profile
团队详细信息
</
h1
>
<
ol
class
=
"breadcrumb"
>
<
li
><
a
href
=
"#"
><
i
class
=
"fa fa-dashboard"
></
i
>
Home
</
a
></
li
>
...
...
resources/views/admin/group/grouptables.blade.php
View file @
28e8d641
...
...
@@ -5,8 +5,8 @@
<!--
Content
Header
(
Page
header
)
-->
<
section
class
=
"content-header"
>
<
h1
>
User
Tables
<
small
>
advanced
tables
</
small
>
团队列表
{{
--<
small
>
advanced
tables
</
small
>--
}}
</
h1
>
<
ol
class
=
"breadcrumb"
>
<
li
><
a
href
=
"#"
><
i
class
=
"fa fa-dashboard"
></
i
>
Home
</
a
></
li
>
...
...
@@ -21,17 +21,17 @@
<
div
class
=
"col-xs-12"
>
<
div
class
=
"box"
>
<
div
class
=
"box-header"
>
<
h3
class
=
"box-title"
>
Hover
Data
Table
</
h3
>
{{
--<
h3
class
=
"box-title"
>
Hover
Data
Table
</
h3
>--
}}
</
div
>
<!--
/.
box
-
header
-->
<
div
class
=
"box-body"
>
<
form
action
=
"
{
{url('
user
/search')}
}
"
>
<
form
action
=
"
{
{url('
group
/search')}
}
"
>
<
div
class
=
"row"
>
<
div
class
=
"col-lg-6"
>
<
div
class
=
"input-group"
>
<
input
type
=
"text"
class
=
"form-control"
placeholder
=
"
Search for...
"
name
=
"search"
>
<
input
type
=
"text"
class
=
"form-control"
placeholder
=
"
团队名称
"
name
=
"search"
>
<
span
class
=
"input-group-btn"
>
<
button
class
=
"btn btn-default"
>
搜索
</
button
>
...
...
@@ -67,8 +67,8 @@
<
tbody
>
<
tr
>
<
td
>
{{
$group
->
id
}}
</
td
>
<
td
><
a
href
=
"
{
{route('user.get',$group->owner_id)}}">{{$group->
owne
r->user_name}
}
</a></td>
<td>
{
{$group->
creato
r->user_name}
}
</td>
<
td
><
a
href
=
"
{
{route('user.get',$group->owner_id)}}">{{$group->
creato
r->user_name}
}
</a></td>
<td>
{
{$group->
owne
r->user_name}
}
</td>
<td>
{
{$group->name}
}
</td>
<td>
{
{$group->brief}
}
</td>
<td>{{$group->logo ==''?'暂无':
$group->logo
}}</td>
...
...
resources/views/admin/group/transfer.blade.php
View file @
28e8d641
...
...
@@ -5,11 +5,11 @@
<!--
general
form
elements
-->
<
div
class
=
"box box-primary"
>
<
div
class
=
"box-header with-border"
>
<
h3
class
=
"box-title"
>
Modify
the
information
</
h3
>
<
h3
class
=
"box-title"
>
团队转让
</
h3
>
</
div
>
<!--
/.
box
-
header
-->
<!--
form
start
-->
<
form
role
=
"form"
action
=
"
{
{route('group.
update')}
}
"
method
=
"post"
enctype
=
"multipart/form-data
"
>
<
form
role
=
"form"
action
=
"
{
{route('group.
transfer')}
}
"
method
=
"post"
enctype
=
"multipart/form-data"
onsubmit
=
"return checkForm()
"
>
{{
csrf_field
()}}
...
...
@@ -18,21 +18,26 @@
<
div
class
=
"form-group"
>
<
label
for
=
"exampleInputEmail1"
>
拥有者
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"exampleInputEmail1"
placeholder
=
"name"
name
=
"name"
value
=
"
{
{$group->owner->user_name}
}
"
>
<
input
type
=
"hidden"
name
=
"id"
value
=
"
{
{$group['id']}
}
"
>
</
div
>
<
div
class
=
"form-group"
>
<
label
for
=
"exampleInputPassword1"
>
转让
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"exampleInputPassword1"
placeholder
=
"name"
value
=
""
>
<
p
style
=
"color: red; display: none"
id
=
"pp"
>*
无此用户请重新填写
</
p
>
<
p
style
=
"color: green; display: none"
id
=
"pp1"
>*
用户存在可以转让
</
p
>
<
p
style
=
"color: green; display: none"
id
=
"pp2"
>*
请输入转让人真实姓名
</
p
>
<
input
type
=
"hidden"
id
=
"owner_id"
value
=
""
name
=
"new_owner_id"
>
<
input
type
=
"hidden"
id
=
"owner_id"
value
=
""
name
=
"a"
>
</
div
>
</
div
>
<!--
/.
box
-
body
-->
<
div
class
=
"box-footer"
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
>
保存
</
button
>
<
p
type
=
"submit"
class
=
"btn btn-primary"
id
=
"asd"
>
查询
</
p
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
id
=
"button"
>
保存
</
button
>
</
div
>
</
form
>
</
div
>
...
...
@@ -41,62 +46,82 @@
<
script
>
$
(
'#exampleInputPassword1'
)
.
blur
(
function
(){
var
real_name
=
$
(
'#exampleInputPassword1'
)
.
val
();
$
(
'#exampleInputPassword1'
)
.
focus
(
function
()
{
$
(
'#pp'
)
.
hide
()
$
(
'#pp1'
)
.
hide
()
$
(
'#pp2'
)
.
hide
()
})
$
.
ajax
({
var
a
=
$
(
'#asd'
)
.
click
(
function
()
{
var
real_name
=
$
(
'#exampleInputPassword1'
)
.
val
();
$
.
ajax
({
type
:
'get'
,
url
:
'{{url('
group
/
ajax
')}}/'
+
real_name
,
success
:
function
(
data
){
if
(
data
){
// 设置 新的拥有者的ID
$
(
'#owner_id'
)
.
val
(
data
);
// 设置 新的拥有者的ID
$
(
'#owner_id'
)
.
val
(
data
);
$
(
'#pp1'
)
.
show
();
}
else
{
alert
(
'无此用户'
)
$
(
'#owner_id'
)
.
val
(
data
);
if
(
$
(
'#owner_id'
)
.
val
()
==
''
){
$
(
'#pp'
)
.
show
();
}
}
},
error
:
function
(
data
){
console
.
log
(
'错误'
);
}
})
}
})
})
});
function
checkForm
()
{
console
.
log
(
$
(
'#owner_id'
)
.
val
())
;
if
(
$
(
'#owner_id'
)
.
val
()
==
''
){
alert
(
'请先查询用户是否存在'
);
return
false
;
}
return
true
;
}
function
base64_uploading
(
base64Data
,
fileName
){
$
.
ajax
({
type
:
'post'
,
url
:
"
{
{url('user/update')}
}
"
,
data
:
{
'base64'
:
base64Data
,
'name'
:
fileName
},
dataType
:
"json"
,
headers
:
{
'X-CSRF-TOKEN'
:
$
(
'meta[name="_token"]'
)
.
attr
(
'content'
)
},
success
:
function
(
data
){
console
.
log
(
data
);
if
(
data
==
1
){
alert
(
'上传成功'
)
}
else
{
alert
(
'上传失败'
)
}
},
error
:
function
(
data
)
{
alert
(
1
);
console
.
log
(
data
);
}
})
}
{{
--
function
base64_uploading
(
base64Data
,
fileName
){
--
}}
{{
--
$
.
ajax
({
--
}}
{{
--
type
:
'post'
,
--
}}
{{
--
url
:
"
{
{url('user/update')}}",--}
}
{{--data:
{
--}
}
{
{--'base64':base64Data,--}
}
{
{--'name':fileName--}
}
{
{--},--}
}
{
{--dataType:"json",--}
}
{{--headers:
{
--}
}
{{--'X-CSRF-TOKEN': $('meta[name="
_token
"]').attr('content')--}}
{
{--},--}
}
{
{--success:function(data){--}
}
{
{--console.log(data);--}
}
{{--if (data ==1 )
{
--}
}
{
{--alert('上传成功')--}
}
{
{--
}
else
{
--}
}
{
{--alert('上传失败')--}
}
{
{--}--}
}
{
{--},--}
}
{{--error:function (data)
{
--}
}
{
{--alert(1);--}
}
{
{--console.log(data);--}
}
{
{--}--}
}
{
{--})--}
}
{
{--}--}
}
...
...
resources/views/admin/group/update.blade.php
View file @
28e8d641
...
...
@@ -5,7 +5,7 @@
<!--
general
form
elements
-->
<
div
class
=
"box box-primary"
>
<
div
class
=
"box-header with-border"
>
<
h3
class
=
"box-title"
>
Modify
the
information
</
h3
>
<
h3
class
=
"box-title"
>
团队信息编辑
</
h3
>
</
div
>
<!--
/.
box
-
header
-->
<!--
form
start
-->
...
...
@@ -33,7 +33,7 @@
</
div
>
<
div
class
=
"form-group"
>
<
label
for
=
"exampleInputPassword1"
>
拥有者
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"exampleInputPassword1"
placeholder
=
"owner"
name
=
"owner_id"
value
=
"
{
{$group->owner->user_name}
}
"
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"exampleInputPassword1"
placeholder
=
"owner"
name
=
"owner_id"
value
=
"
{
{$group->owner->user_name}
}
"
readonly
>
</
div
>
...
...
resources/views/admin/sidebar.blade.php
View file @
28e8d641
...
...
@@ -32,7 +32,7 @@
<!-- Sidebar Menu -->
<ul
class=
"sidebar-menu"
>
<li
class=
"header"
>
HEADER
</li>
{{--
<li
class=
"header"
>
</li>
--}}
<!-- Optionally, you can add icons to the links -->
<li
class=
"active"
><a
href=
"{{url('statistics')}}"
><i
class=
"fa fa-link"
></i>
<span>
首页
</span></a></li>
...
...
@@ -44,7 +44,7 @@
</a>
<ul
class=
"treeview-menu"
>
<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>
</li>
...
...
@@ -58,10 +58,24 @@
</a>
<ul
class=
"treeview-menu"
>
<li><a
href=
"{{url('group/getAll')}}"
>
团队列表
</a></li>
<li><a
href=
"#"
>
Link in level 2
</a></li>
{{--
<li><a
href=
"#"
>
Link in level 2
</a></li>
--}}
</ul>
</li>
<li
class=
"treeview"
>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
系统设置
</span>
<span
class=
"pull-right-container"
>
<i
class=
"fa fa-angle-left pull-right"
></i>
</span>
</a>
<ul
class=
"treeview-menu"
>
<li><a
href=
"{{url('group/getAll')}}"
>
短信通知余额
</a></li>
</ul>
</li>
</ul>
<!-- /.sidebar-menu -->
</section>
...
...
resources/views/admin/user/update.blade.php
View file @
28e8d641
...
...
@@ -5,7 +5,7 @@
<!--
general
form
elements
-->
<
div
class
=
"box box-primary"
>
<
div
class
=
"box-header with-border"
>
<
h3
class
=
"box-title"
>
Modify
the
information
</
h3
>
<
h3
class
=
"box-title"
>
用户信息编辑
</
h3
>
</
div
>
<!--
/.
box
-
header
-->
<!--
form
start
-->
...
...
resources/views/admin/userinformation.blade.php
View file @
28e8d641
...
...
@@ -3,7 +3,7 @@
<
section
class
=
"content-header"
>
<
h1
>
User
Profile
用户详细信息
</
h1
>
<
ol
class
=
"breadcrumb"
>
<
li
><
a
href
=
"#"
><
i
class
=
"fa fa-dashboard"
></
i
>
Home
</
a
></
li
>
...
...
resources/views/admin/usertables.blade.php
View file @
28e8d641
...
...
@@ -5,8 +5,7 @@
<!--
Content
Header
(
Page
header
)
-->
<
section
class
=
"content-header"
>
<
h1
>
User
Tables
<
small
>
advanced
tables
</
small
>
用户列表
</
h1
>
<
ol
class
=
"breadcrumb"
>
<
li
><
a
href
=
"#"
><
i
class
=
"fa fa-dashboard"
></
i
>
Home
</
a
></
li
>
...
...
@@ -21,39 +20,26 @@
<
div
class
=
"col-xs-12"
>
<
div
class
=
"box"
>
<
div
class
=
"box-header"
>
<
h3
class
=
"box-title"
>
Hover
Data
Table
</
h3
>
{{
--<
h3
class
=
"box-title"
></
h3
>--
}}
</
div
>
<!--
/.
box
-
header
-->
<
div
class
=
"box-body"
>
<
form
action
=
"
{
{url('user/search')}
}
"
>
<
div
class
=
"row"
>
<
div
class
=
"col-lg-6"
>
<
div
class
=
"input-group"
>
<
input
type
=
"text"
class
=
"form-control"
placeholder
=
"
Search for...
"
name
=
"search"
>
<
input
type
=
"text"
class
=
"form-control"
placeholder
=
"
用户名、邮箱、手机号码
"
name
=
"search"
>
<
span
class
=
"input-group-btn"
>
<
button
class
=
"btn btn-default"
>
搜索
</
button
>
</
span
>
</
div
><!--
/
input
-
group
-->
</
div
><!--
/.
col
-
lg
-
6
-->
</
div
><!--
/.
row
-->
</
form
>
<
br
>
<
table
id
=
"example2"
class
=
"table table-bordered table-hover"
>
<
thead
>
<
tr
>
...
...
@@ -68,22 +54,14 @@
<
th
>
操作
</
th
>
</
tr
>
</
thead
>
@
if
(
$result
==
null
)
<
tbody
>
<
tr
>
<
td
colspan
=
"9"
style
=
"text-align: center;color: red"
>
数据暂无
</
td
>
</
tr
>
</
tbody
>
</
table
>
@
else
@
else
@
foreach
(
$result
as
$value
)
<
tbody
>
<
tr
>
...
...
routes/web.php
View file @
28e8d641
...
...
@@ -10,10 +10,14 @@
| contains the "web" middleware group. Now create something great!
|
*/
//
//Route::get('/', function () {
// return view('admin/dashboard');
//});
Route
::
get
(
'/'
,
function
()
{
return
view
(
'admin/dashboard
'
);
}
);
// 统计 首页
Route
::
get
(
'/'
,
'StatisticsController@newUser
'
);
Route
::
get
(
'statistics'
,
'StatisticsController@newUser'
);
Route
::
get
(
'admin'
,
function
(){
...
...
@@ -60,14 +64,11 @@ Route::group(['prefix'=> 'group'],function (){
Route
::
get
(
'transferPage'
,
'GroupController@transferPage'
)
->
name
(
'group.transferPage'
);
Route
::
get
(
'ajax/{name}'
,
'GroupController@ajax'
)
->
name
(
'group.ajax'
);
Route
::
post
(
'transfer'
,
'GroupController@transfer'
)
->
name
(
'group.transfer'
);
Route
::
get
(
'search'
,
'UserController@simpleSearch'
)
->
name
(
'group.search'
);
Route
::
get
(
'search'
,
'GroupController@simpleSearch'
)
->
name
(
'group.search'
);
});
// 统计
Route
::
get
(
'statistics'
,
'StatisticsController@newUser'
);
...
...
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