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
c64e7970
Commit
c64e7970
authored
Nov 07, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改collection 判断方式 修改查询无数据时 页面样式
parent
75932c50
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
49 additions
and
53 deletions
+49
-53
GroupServiceContract.php
app/Contracts/GroupServiceContract.php
+1
-1
GroupController.php
app/Http/Controllers/GroupController.php
+3
-6
UserController.php
app/Http/Controllers/UserController.php
+6
-5
GroupService.php
app/Services/GroupService.php
+6
-22
UserService.php
app/Services/UserService.php
+1
-1
groupinformation.blade.php
resources/views/admin/group/groupinformation.blade.php
+6
-2
grouplike.blade.php
resources/views/admin/group/grouplike.blade.php
+1
-1
transfer.blade.php
resources/views/admin/group/transfer.blade.php
+3
-3
notification.blade.php
resources/views/admin/notification.blade.php
+15
-0
userlike.blade.php
resources/views/admin/user/userlike.blade.php
+2
-2
web.php
routes/web.php
+5
-10
No files found.
app/Contracts/GroupServiceContract.php
View file @
c64e7970
...
...
@@ -18,7 +18,7 @@ interface GroupServiceContract
public
function
get
(
$group_id
);
public
function
getAll
(
$page
);
public
function
ajax
(
$
nam
e
);
public
function
ajax
(
$
phon
e
);
public
function
simpleSearch
(
$search_content
,
$page
);
...
...
app/Http/Controllers/GroupController.php
View file @
c64e7970
...
...
@@ -22,10 +22,7 @@ class GroupController extends Controller
public
function
getAll
()
{
$groups
=
$this
->
mGroup
->
getAll
(
8
);
if
(
count
(
$groups
)
>
0
){
return
view
(
'admin/group/grouptables'
,
compact
(
'groups'
));
}
return
Message
::
makeError
(
'查找失败'
);
return
view
(
'admin/group/grouptables'
,
compact
(
'groups'
));
}
...
...
@@ -148,9 +145,9 @@ class GroupController extends Controller
}
public
function
ajax
(
$
nam
e
)
public
function
ajax
(
$
phon
e
)
{
$result
=
$this
->
mGroup
->
ajax
(
$
nam
e
);
$result
=
$this
->
mGroup
->
ajax
(
$
phon
e
);
if
(
$result
!=
null
){
return
$result
[
'id'
];
}
...
...
app/Http/Controllers/UserController.php
View file @
c64e7970
...
...
@@ -74,11 +74,7 @@ class UserController extends Controller
public
function
getAll
()
{
$result
=
$this
->
mUser
->
getAll
(
8
);
if
(
$result
){
return
view
(
'admin/usertables'
,
compact
(
'result'
));
}
else
{
return
Message
::
makeError
(
'获取失败'
);
}
return
view
(
'admin/usertables'
,
compact
(
'result'
));
}
...
...
@@ -107,4 +103,9 @@ class UserController extends Controller
return
view
(
'admin/user/userlike'
,[
'result'
=>
$result
,
'params'
=>
$search_content
]);
}
public
function
notification
()
{
return
view
(
'admin\notification'
);
}
}
app/Services/GroupService.php
View file @
c64e7970
...
...
@@ -107,19 +107,6 @@ class GroupService implements GroupServiceContract
{
$group
=
Group
::
find
(
$group_id
);
// $groups = Group::find($group_id)->usergroup;
//
// foreach ($groups as $v)
// {
// echo ($v->users[0]['user_name']);
// }
//
// dd($group);
if
(
$group
==
null
){
return
null
;
}
else
{
...
...
@@ -132,8 +119,7 @@ class GroupService implements GroupServiceContract
public
function
getAll
(
$page
)
{
$groups
=
Group
::
paginate
(
$page
);
if
(
count
(
$groups
)
<
0
){
if
(
$groups
->
isEmpty
()){
return
null
;
}
else
{
return
$groups
;
...
...
@@ -141,9 +127,9 @@ class GroupService implements GroupServiceContract
}
public
function
ajax
(
$
nam
e
)
public
function
ajax
(
$
phon
e
)
{
$result
=
User
::
where
(
'
real_name'
,
'='
,
$nam
e
)
->
first
();
$result
=
User
::
where
(
'
phone'
,
'='
,
$phon
e
)
->
first
();
if
(
$result
!=
null
){
return
$result
;
}
...
...
@@ -155,11 +141,9 @@ class GroupService implements GroupServiceContract
public
function
simpleSearch
(
$search_content
,
$page
)
{
$group
=
Group
::
where
(
'name'
,
'like'
,
'%'
.
$search_content
.
'%'
)
->
paginate
(
$page
);
if
(
count
(
$group
)
>
0
){
return
$group
;
if
(
$group
->
isEmpty
()){
return
null
;
}
$result
=
null
;
return
$result
;
return
$group
;
}
}
\ No newline at end of file
app/Services/UserService.php
View file @
c64e7970
...
...
@@ -32,7 +32,7 @@ class UserService implements UserServiceContract
public
function
getAll
(
$page
)
{
$users
=
User
::
paginate
(
$page
);
if
(
count
(
$users
)
<
0
){
if
(
$users
->
isEmpty
()
){
return
null
;
}
return
$users
;
...
...
resources/views/admin/group/groupinformation.blade.php
View file @
c64e7970
...
...
@@ -98,13 +98,17 @@
<
li
><
a
href
=
"#timeline"
data
-
toggle
=
"tab"
>
Timeline
</
a
></
li
>
<
li
><
a
href
=
"#settings"
data
-
toggle
=
"tab"
>
Settings
</
a
></
li
>
</
ul
>
<
div
class
=
"tab-content"
>
<
div
class
=
"tab-content"
style
=
"height: 600px"
>
<
div
class
=
"active tab-pane"
id
=
"activity"
style
=
"overflow: hidden"
>
@
if
(
count
(
$groups
->
usergroup
)
==
0
)
<
h3
>
团队还没有成员加入
</
h3
>
<
h5
>
团队暂无成员
</
h5
>
<
h2
></
h2
>
@
else
@
foreach
(
$groups
->
usergroup
as
$user
)
...
...
resources/views/admin/group/grouplike.blade.php
View file @
c64e7970
...
...
@@ -57,7 +57,7 @@
@
if
(
$groups
==
null
)
<
tbody
>
<
tr
>
<
td
colspan
=
"8"
style
=
"text-align: center;color: red"
>
数据暂无
</
td
>
<
td
colspan
=
"8"
style
=
"text-align: center;color: red"
>
查询失败
,
相关数据
!
</
td
>
</
tr
>
</
tbody
>
</
table
>
...
...
resources/views/admin/group/transfer.blade.php
View file @
c64e7970
...
...
@@ -24,7 +24,7 @@
</
div
>
<
div
class
=
"form-group"
>
<
label
for
=
"exampleInputPassword1"
>
转让
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"exampleInputPassword1"
placeholder
=
"
name
"
value
=
""
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"exampleInputPassword1"
placeholder
=
"
用户手机号码
"
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
>
...
...
@@ -54,10 +54,10 @@
})
var
a
=
$
(
'#asd'
)
.
click
(
function
()
{
var
real_nam
e
=
$
(
'#exampleInputPassword1'
)
.
val
();
var
user_phon
e
=
$
(
'#exampleInputPassword1'
)
.
val
();
$
.
ajax
({
type
:
'get'
,
url
:
'{{url('
group
/
ajax
')}}/'
+
real_nam
e
,
url
:
'{{url('
group
/
ajax
')}}/'
+
user_phon
e
,
success
:
function
(
data
){
if
(
data
){
// 设置 新的拥有者的ID
...
...
resources/views/admin/notification.blade.php
0 → 100644
View file @
c64e7970
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<title>
Document
</title>
</head>
<body>
<h1>
biu~biu~biu~ 暂时没有数据
</h1>
</body>
</html>
\ No newline at end of file
resources/views/admin/user/userlike.blade.php
View file @
c64e7970
...
...
@@ -54,10 +54,10 @@
<
th
>
操作
</
th
>
</
tr
>
</
thead
>
@
if
(
$result
==
null
)
@
if
(
$result
->
isEmpty
()
)
<
tbody
>
<
tr
>
<
td
colspan
=
"9"
style
=
"text-align: center;color: red"
>
数据暂无
</
td
>
<
td
colspan
=
"9"
style
=
"text-align: center;color: red"
>
用户查询失败
,
无相关用户
</
td
>
</
tr
>
</
tbody
>
</
table
>
...
...
routes/web.php
View file @
c64e7970
...
...
@@ -26,18 +26,10 @@ Route::get('admin',function (){
});
Auth
::
routes
();
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
// 短信
Route
::
get
(
'sms'
,
'SMSController@surplus'
);
...
...
@@ -50,8 +42,10 @@ Route::group(['prefix'=> 'user'],function (){
Route
::
get
(
'get/{id}'
,
'UserController@get'
)
->
name
(
'user.get'
);
Route
::
get
(
'updatePage/{id}'
,
'UserController@updatePage'
)
->
name
(
'user.updatePage'
);
Route
::
post
(
'update'
,
'UserController@update'
)
->
name
(
'user.update'
);
Route
::
get
(
'search'
,
'UserController@simpleSearch'
)
->
name
(
'user.search'
);
Route
::
get
(
'notification'
,
'UserController@notification'
)
->
name
(
'notification'
);
});
...
...
@@ -65,9 +59,10 @@ Route::group(['prefix'=> 'group'],function (){
Route
::
post
(
'update'
,
'GroupController@update'
)
->
name
(
'group.update'
);
Route
::
get
(
'transferPage'
,
'GroupController@transferPage'
)
->
name
(
'group.transferPage'
);
Route
::
get
(
'ajax/{
nam
e}'
,
'GroupController@ajax'
)
->
name
(
'group.ajax'
);
Route
::
get
(
'ajax/{
phon
e}'
,
'GroupController@ajax'
)
->
name
(
'group.ajax'
);
Route
::
post
(
'transfer'
,
'GroupController@transfer'
)
->
name
(
'group.transfer'
);
Route
::
get
(
'search'
,
'GroupController@simpleSearch'
)
->
name
(
'group.search'
);
});
// 项目
...
...
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