Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
d99769bb
Commit
d99769bb
authored
Sep 07, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goods
parent
178e1d77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+12
-2
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
d99769bb
...
...
@@ -350,14 +350,24 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
//商品图片表
$goodsImagesInstance
=
\DAO\GoodsImagesModel
::
getInstance
();
$image
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsImagesRedisModel
::
getInstance
(),
array
(
&
$goodsImagesInstance
,
'getListByCommonId'
),
array
(
$goodsCommonId
,
'attr_name,attr_value,goods_image'
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$goodsCommonId
));
$attrImage
=
[];
$images
=
[];
$haveImg
=
false
;
$goodsImageGroup
=
unserialize
(
$commonInfo
[
'goods_image_group'
]);
if
(
$goodsImageGroup
)
{
$haveImg
=
true
;
foreach
(
$goodsImageGroup
as
$v
)
{
$images
[]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$v
,
\Our\ImageConst
::
goodsDetailImgSize
);
}
}
$attrImage
=
[];
if
(
$image
&&
is_array
(
$image
)){
$i
=
0
;
foreach
(
$image
as
$k
=>
$v
){
$image
[
$k
][
'goods_image'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$v
[
'goods_image'
],
\Our\ImageConst
::
SpecSelectGoodsImgSize
);
$attrImage
[
$v
[
'attr_name'
]][
$v
[
'attr_value'
]][]
=
$image
[
$k
][
'goods_image'
];
if
(
$i
<
5
){
if
(
$i
<
5
&&
!
$haveImg
){
$images
[]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$v
[
'goods_image'
],
\Our\ImageConst
::
goodsDetailImgSize
);
}
$i
+=
1
;
...
...
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