Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
6936ed269842296371878bd1edbc58efbb4cf22d
1 parent
763fcc84
修复详情页接口返回至断未定义goodsImagesList报错的bug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
6936ed2
...
...
@@ -165,26 +165,31 @@ class DetailModel
foreach
(
$baseInfo
[
'goodsList'
]
as
$value
)
{
$colorId
=
intval
(
$value
[
'colorId'
]);
// 商品按颜色进行分类分组
foreach
(
$value
[
'goodsImagesList'
]
as
$goods
)
{
$goodsList
[
$goods
[
'goodsId'
]]
=
$colorId
;
$goodsGroup
[
$colorId
][]
=
array
(
'goodsId'
=>
$goods
[
'goodsId'
],
'img'
=>
$goods
[
'imageUrl'
],
);
$colorGroup
[
$colorId
]
=
array
(
'colorId'
=>
$colorId
,
'colorName'
=>
$value
[
'colorName'
],
'colorImage'
=>
Helpers
::
getImageUrl
(
$value
[
'colorImage'
],
60
,
60
),
);
}
if
(
isset
(
$value
[
'goodsImagesList'
]))
{
foreach
(
$value
[
'goodsImagesList'
]
as
$goods
)
{
$goodsList
[
$goods
[
'goodsId'
]]
=
$colorId
;
$goodsGroup
[
$colorId
][]
=
array
(
'goodsId'
=>
$goods
[
'goodsId'
],
'img'
=>
$goods
[
'imageUrl'
],
);
$colorGroup
[
$colorId
]
=
array
(
'colorId'
=>
$colorId
,
'colorName'
=>
$value
[
'colorName'
],
'colorImage'
=>
Helpers
::
getImageUrl
(
$value
[
'colorImage'
],
60
,
60
),
);
}
}
// 商品的尺码列表
foreach
(
$value
[
'goodsSizeBoList'
]
as
$size
)
{
$sizeGroup
[
$colorId
]
=
array
(
'sizeName'
=>
$size
[
'sizeName'
],
'sizeSku'
=>
$size
[
'goodsSizeSkuId'
],
'sizeStorage'
=>
$size
[
'goodsSizeStorageNum'
],
);
}
if
(
isset
(
$value
[
'goodsSizeBoList'
]))
{
foreach
(
$value
[
'goodsSizeBoList'
]
as
$size
)
{
$sizeGroup
[
$colorId
]
=
array
(
'sizeName'
=>
$size
[
'sizeName'
],
'sizeSku'
=>
$size
[
'goodsSizeSkuId'
],
'sizeStorage'
=>
$size
[
'goodsSizeStorageNum'
],
);
}
}
}
// 商品图
...
...
Please
register
or
login
to post a comment