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
a140629a
Commit
a140629a
authored
Sep 05, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into lyz
parents
75b902b5
c70323d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
ImageConst.php
application/library/Our/ImageConst.php
+3
-1
ImageUtil.php
application/library/Our/ImageUtil.php
+9
-2
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+1
-1
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+4
-3
No files found.
application/library/Our/ImageConst.php
View file @
a140629a
...
...
@@ -104,5 +104,7 @@ class ImageConst{
const
storeQualificationImg
=
188
;
const
storeCollectionImg
=
112
;
const
homeIndexHotGoodsImageSize
=
250
;
const
goodsStoreImg
=
100
;
//商品详情页的店铺头像
const
goodsGroupImg
=
182
;
//商品/组合详情页的其他搭配图片
const
groupGoodsImg
=
160
;
//组合详情页的搭配商品
}
application/library/Our/ImageUtil.php
View file @
a140629a
...
...
@@ -126,10 +126,17 @@ class ImageUtil {
//$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334';
}
$goodsImg
=
\Our\Common
::
getStaticFile
(
$goodsImg
,
$directory
);
$goodsImg
.=
"?x-oss-process=image/resize,m_fill,h_
{
$height
}
,w_
{
$width
}
"
;
if
(
$width
>
0
)
{
$goodsImg
.=
"?x-oss-process=image/resize,m_fill,h_
{
$height
}
,w_
{
$width
}
"
;
}
return
$goodsImg
;
}
public
function
getGoodsImgWithUrl
(
$goodsImgUrl
,
$width
=
\Our\ImageConst
::
goodsListImgSize
,
$height
=
0
)
{
$width
=
$width
*
\Our\ImageConst
::
sizeScale
;
$height
?
$height
=
$height
*
\Our\ImageConst
::
sizeScale
:
$height
=
$width
;
$goodsImgUrl
.=
"?x-oss-process=image/resize,m_fill,h_
{
$height
}
,w_
{
$width
}
"
;
return
$goodsImgUrl
;
}
public
static
function
getTopClassAdvImageUrl
(
$gcId
){
$fileName
=
\Our\ImageConst
::
topClassAdvImagePrefis
.
$gcId
.
\Our\NameConst
::
jpgSuffix
;
$gcImageUrl
=
\Our\Common
::
getStaticFile
(
$fileName
,
\Our\ImageConst
::
defaultPath
);
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
a140629a
...
...
@@ -524,7 +524,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$commonInstance
=
\DAO\GoodsCommonModel
::
getInstance
();
$count
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
(),
array
(
&
$commonInstance
,
'getCount'
),
array
(
array
(
'store_id'
=>
$storeId
)),
\Our\ApiConst
::
oneDaySecond
);
return
array
(
'storeId'
=>
$storeId
,
'storeName'
=>
$storeInfo
[
'store_name'
],
'storeLabel'
=>
$label
,
'goodsTotal'
=>
$count
,
'isQuality'
=>
$storeInfo
[
'store_zhping'
],
'freeShippingPrice'
=>
$storeInfo
[
'free_shipping_price'
],
'shareDesc'
=>
$storeInfo
[
'store_share_desc'
]);
return
array
(
'storeId'
=>
$storeId
,
'storeName'
=>
$storeInfo
[
'store_name'
],
'storeLabel'
=>
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$storeInfo
[
'store_label'
],
\Our\ImageConst
::
goodsStoreImg
)
,
'goodsTotal'
=>
$count
,
'isQuality'
=>
$storeInfo
[
'store_zhping'
],
'freeShippingPrice'
=>
$storeInfo
[
'free_shipping_price'
],
'shareDesc'
=>
$storeInfo
[
'store_share_desc'
]);
}
/**
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
a140629a
...
...
@@ -50,6 +50,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$data
[
'goods'
]
=
[];
if
(
$data
[
'goodsList'
]
&&
is_array
(
$data
[
'goodsList'
])){
foreach
(
$data
[
'goodsList'
]
as
$v
){
$v
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgWithUrl
(
$v
[
'goodsImage'
],
\Our\ImageConst
::
groupGoodsImg
);
unset
(
$v
[
'goods_id'
]);
unset
(
$v
[
'goodsStorage'
]);
unset
(
$v
[
'goodsAttr'
]);
...
...
@@ -227,7 +228,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if
(
$groupList
){
foreach
(
$groupList
as
$k
=>
$v
){
$v
[
'groupId'
]
=
$v
[
'blId'
];
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]);
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]
,
\our\ImageConst
::
goodsGroupImg
);
unset
(
$v
[
'goodsList'
]);
unset
(
$v
[
'bl_title'
]);
unset
(
$v
[
'store_id'
]);
...
...
@@ -295,7 +296,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach
(
$group
as
$k
=>
$v
){
if
(
$v
[
'bl_quota_starttime'
]
<
TIMESTAMP
&&
$v
[
'endTime'
]
>=
TIMESTAMP
){
$v
[
'groupId'
]
=
$v
[
'blId'
];
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]);
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]
,
\Our\ImageConst
::
goodsGroupImg
);
unset
(
$v
[
'goodsList'
]);
unset
(
$v
[
'bl_title'
]);
unset
(
$v
[
'store_id'
]);
...
...
@@ -469,7 +470,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$goods_temp
=
array_merge
(
$goods
,
$goodsArray
[
$goods
[
'goods_id'
]]);
$blSumPrice
+=
$goods_temp
[
'goodsPrice'
]
*
$goods_temp
[
'num'
];
$goods_temp
[
'goodsAttr'
]
=
$goodsDao
->
getFormatGoodsAttr
(
$goods_temp
[
'goods_spec'
]);
$goods_temp
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goods_temp
[
'goods_image'
]);
$goods_temp
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goods_temp
[
'goods_image'
]
,
0
);
//unset($goods_temp['goods_spec']);
//unset($goods_temp['goods_image']);
//unset($goods_temp['bl_id']);
...
...
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