Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
77b1f814
authored
Oct 10, 2018
by
叶明星
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ymx-账期管理-2018091009' into development
parents
13339d29
8ac8db53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
34 deletions
app/Http/Controllers/WebController.php
app/Http/Function.php
app/Http/Controllers/WebController.php
View file @
77b1f814
...
...
@@ -9,25 +9,6 @@ use App\Http\Requests;
use
App\Http\Controllers\Controller
;
use
DB
;
function
CheckActive
(
$menus
,
&
$arr
,
$url
)
{
for
(
$i
=
0
;
$i
<
count
(
$menus
);
$i
++
)
{
$menu
=
$menus
[
$i
];
array_push
(
$arr
,
$i
);
if
(
isset
(
$menu
->
href
)
&&
(
$menu
->
href
==
$url
||
(
$menu
->
href
==
'/'
&&
$url
==
'//'
)))
return
true
;
if
(
isset
(
$menu
->
childs
)
&&
count
(
$menu
->
childs
)
>
0
)
{
$ret
=
CheckActive
(
$menu
->
childs
,
$arr
,
$url
);
if
(
$ret
)
return
$ret
;
}
array_pop
(
$arr
);
}
return
false
;
}
function
createMenuReal
(
$menus
,
$active
,
$level
)
{
$subclass
=
(
$level
==
0
)
?
'nav-second-level'
:
'nav-third-level'
;
...
...
@@ -70,21 +51,6 @@ function createMenu($menus, $url)
return
createMenuReal
(
$menus
,
$actives
,
0
);
}
function
Crumbs
(
$menus
,
$uri
)
{
$actives
=
[];
CheckActive
(
$menus
,
$actives
,
$uri
);
$ret
=
''
;
foreach
(
$actives
as
$k
=>
$v
)
{
if
(
$k
==
count
(
$actives
)
-
1
)
{
$ret
.=
'<li class="active"><a>'
.
$menus
[
$actives
[
0
]]
->
childs
[
$actives
[
1
]]
->
title
.
'</a></li>'
;
}
else
{
$ret
.=
'<li><a href="#">'
.
$menus
[
$actives
[
0
]]
->
title
.
'</a></li>'
;
}
}
return
$ret
;
}
class
WebController
extends
Controller
{
// 页面用户、菜单信息
...
...
app/Http/Function.php
View file @
77b1f814
...
...
@@ -194,4 +194,38 @@
$method
=
!
empty
(
$backtrace
[
'function'
])
?
$backtrace
[
'function'
]
:
''
;
\LogReport
::
write
(
\LogReport
::
anlyError
(
$err_msg
,
$file
,
$line
,
$err_code
,
$method
));
}
function
Crumbs
(
$menus
,
$uri
)
{
$actives
=
[];
CheckActive
(
$menus
,
$actives
,
$uri
);
$ret
=
''
;
foreach
(
$actives
as
$k
=>
$v
)
{
if
(
$k
==
count
(
$actives
)
-
1
)
{
$ret
.=
'<li class="active"><a>'
.
$menus
[
$actives
[
0
]]
->
childs
[
$actives
[
1
]]
->
title
.
'</a></li>'
;
}
else
{
$ret
.=
'<li><a href="#">'
.
$menus
[
$actives
[
0
]]
->
title
.
'</a></li>'
;
}
}
return
$ret
;
}
function
CheckActive
(
$menus
,
&
$arr
,
$url
)
{
for
(
$i
=
0
;
$i
<
count
(
$menus
);
$i
++
)
{
$menu
=
$menus
[
$i
];
array_push
(
$arr
,
$i
);
if
(
isset
(
$menu
->
href
)
&&
(
$menu
->
href
==
$url
||
(
$menu
->
href
==
'/'
&&
$url
==
'//'
)))
return
true
;
if
(
isset
(
$menu
->
childs
)
&&
count
(
$menu
->
childs
)
>
0
)
{
$ret
=
CheckActive
(
$menu
->
childs
,
$arr
,
$url
);
if
(
$ret
)
return
$ret
;
}
array_pop
(
$arr
);
}
return
false
;
}
\ No newline at end of file
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