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
hf
9 years ago
Commit
aeaf3f4f793c116c81bed2108f3ccb235921c07a
1 parent
cd348093
code review by fei.hong : do merge produt detail page limit code
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
aeaf3f4
...
...
@@ -761,6 +761,7 @@ class DetailModel
do
{
$productData
=
DetailData
::
limitProductData
(
$uid
,
$productCode
);
if
(
empty
(
$productData
)
||
empty
(
$productData
[
'data'
]))
{
break
;
}
...
...
@@ -775,12 +776,22 @@ class DetailModel
$result
[
'description'
]
=
$product
[
'description'
];
// 附件
if
(
isset
(
$product
[
'attachment'
]))
{
foreach
(
$product
[
'attachment'
]
as
$item
)
{
$result
[
'attaches'
][]
=
self
::
procLimitProductAttach
(
$item
);
if
(
!
isset
(
$product
[
'attachment'
]))
{
break
;
}
$result
[
'attaches'
]
=
array
();
foreach
(
$product
[
'attachment'
]
as
$item
)
{
if
(
$item
[
'isDefault'
]
===
1
)
{
// 排除默认图片
continue
;
}
$result
[
'attaches'
][]
=
self
::
procLimitProductAttach
(
$item
);
}
if
(
count
(
$result
[
'attaches'
])
>
1
)
{
Helpers
::
sortArrByField
(
$result
[
'attaches'
],
'orderBy'
,
true
);
}
}
while
(
false
);
return
$result
;
...
...
@@ -801,31 +812,27 @@ class DetailModel
$result
[
'img'
]
=
array
(
'attachUrl'
=>
Helpers
::
getImageUrl
(
$attachment
[
'attachUrl'
],
750
,
''
),
'attachName'
=>
$attachment
[
'attachName'
],
'intro'
=>
$attachment
[
'intro'
],
'orderBy'
=>
$attachment
[
'orderBy'
]
'intro'
=>
$attachment
[
'intro'
]
);
$result
[
'orderBy'
]
=
$attachment
[
'orderBy'
];
break
;
case
2
:
// 视频
$result
[
'video'
]
=
array
(
'attachUrl'
=>
$attachment
[
'attachUrl'
],
'orderBy'
=>
$attachment
[
'orderBy'
],
'img'
=>
Helpers
::
getImageUrl
(
$attachment
[
'intro'
],
750
,
''
)
);
$result
[
'orderBy'
]
=
$attachment
[
'orderBy'
];
break
;
case
3
:
// 文本类型
$result
[
'text'
]
=
array
(
'intro'
=>
$attachment
[
'intro'
],
'orderBy'
=>
$attachment
[
'orderBy'
]
'intro'
=>
$attachment
[
'intro'
]
);
$result
[
'orderBy'
]
=
$attachment
[
'orderBy'
];
break
;
default
:
break
;
}
if
(
count
(
$result
)
>
1
)
{
Helpers
::
sortArrByField
(
$result
,
'orderBy'
,
true
,
SORT_NUMERIC
);
}
return
$result
;
}
...
...
Please
register
or
login
to post a comment