Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yangyang
9 years ago
Commit
cb3245b68799246f965f489359d913cf40bdabdd
1 parent
2ca47f9c
改动格式
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
33 deletions
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Home/Order.php
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
cb3245b
...
...
@@ -495,7 +495,11 @@ class HomeController extends AbstractAction
if
(
!
empty
(
$data
))
{
$order
[
'orders'
]
=
$data
;
}
else
{
$order
[
'walkwayUrl'
]
=
'http://www.baidu.com'
;
if
(
$page
>
1
)
{
echo
" "
;
}
else
{
$order
[
'walkwayUrl'
]
=
'http://www.baidu.com'
;
}
}
//渲染模板
$this
->
_view
->
display
(
'order-content'
,
$order
);
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
cb3245b
...
...
@@ -121,55 +121,58 @@ class OrderModel
}
return
$arr
;
}
//根据type值设置nav属性
public
function
getNavs
(
$type
){
public
function
getNavs
(
$type
)
{
$nav
=
array
(
array
(
'name'
=>
'全部'
,
'typeId'
=>
'1'
'typeId'
=>
'1'
,
'url'
=>
'/home/order?type=1'
),
array
(
'name'
=>
'待付款'
,
'typeId'
=>
'2'
'typeId'
=>
'2'
,
'url'
=>
'/home/order?type=2'
),
array
(
'name'
=>
'待发货'
,
'typeId'
=>
'3'
'typeId'
=>
'3'
,
'url'
=>
'/home/order?type=3'
),
array
(
'name'
=>
'待收货'
,
'typeId'
=>
'4'
'typeId'
=>
'4'
,
'url'
=>
'/home/order?type=4'
)
);
foreach
(
$nav
as
$key
=>
$vo
){
switch
(
$type
)
{
case
1
:
if
(
$vo
[
'typeId'
]
==
1
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
2
:
if
(
$vo
[
'typeId'
]
==
2
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
3
:
if
(
$vo
[
'typeId'
]
==
3
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
4
:
if
(
$vo
[
'typeId'
]
==
4
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
default
:
break
;
}
foreach
(
$nav
as
$key
=>
$vo
)
{
switch
(
$type
)
{
case
1
:
if
(
$vo
[
'typeId'
]
==
1
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
2
:
if
(
$vo
[
'typeId'
]
==
2
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
3
:
if
(
$vo
[
'typeId'
]
==
3
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
4
:
if
(
$vo
[
'typeId'
]
==
4
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
default
:
break
;
}
}
return
$nav
;
}
}
...
...
Please
register
or
login
to post a comment