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
f63dfcae
Commit
f63dfcae
authored
Sep 19, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车商品规格图片处理
parent
6ece0365
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
ImageConst.php
application/library/Our/ImageConst.php
+4
-0
CartService.php
application/models/Business/Cart/CartService.php
+0
-1
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+23
-2
No files found.
application/library/Our/ImageConst.php
View file @
f63dfcae
...
...
@@ -111,4 +111,8 @@ class ImageConst{
const
groupGoodsImg
=
160
;
//组合详情页的搭配商品
const
storeGroupImg
=
186
;
//店铺促销
const
storeGroupGoodsImg
=
130
;
const
cartBlImage
=
184
;
const
cartBlDetailImage
=
148
;
}
application/models/Business/Cart/CartService.php
View file @
f63dfcae
...
...
@@ -449,7 +449,6 @@ class CartServiceModel extends \Business\AbstractModel{
$field
=
'MAX(gmt_update) AS gmtupdate,store_id'
;
$group
=
'store_id'
;
$storeIds
=
$cartDao
->
getCartStoreIdsByMemberId
(
$where
,
$memberId
,
$field
,
$group
,
$order
);
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$storeIds
));
//$cartStores = $cartDao->lists($where,$order,$field,$data['pageIndex'],$data['pageSize'],$group);
$storeIdList
=
array_column
(
$storeIds
,
'store_id'
);
$totalCount
=
count
(
$storeIdList
);
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
f63dfcae
...
...
@@ -114,6 +114,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
//$pBundlingList = $this->getGroupListForCart($blIds);
//var_dump($pBundlingList);
$pBundlingList
=
$this
->
getPBundlingListByBlIds
(
$blIds
,
\Our\DbNameConst
::
salveDBConnectName
,
true
);
$pBundlingList
=
$this
->
getResizeGroupSaleGoodsList
(
$pBundlingList
);
}
$goodsCommonIds
=
$cartListData
[
'goodsCommonIds'
];
$goodsIds
=
$cartListData
[
'goodsIds'
];
...
...
@@ -138,7 +139,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$tempObj
[
'goodsName'
]
=
$tempCart
[
'goods_name'
];
$tempObj
[
'goodsPrice'
]
=
$tempCart
[
'goods_price'
];
$tempObj
[
'goodsNum'
]
=
$tempCart
[
'goods_num'
];
$tempObj
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$tempCart
[
'goods_image'
]);
$tempObj
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$tempCart
[
'goods_image'
]
,
\Our\ImageConst
::
cartBlImage
);
$tempObj
[
'type'
]
=
$tempCart
[
'type'
];
if
(
$tempCart
[
'type'
]
==
\Our\ApiConst
::
addBundingToCart
)
{
$pBundling
=
isset
(
$pBundlingList
[
$tempCart
[
'goods_id'
]])
?
$pBundlingList
[
$tempCart
[
'goods_id'
]]
:
array
();
...
...
@@ -164,13 +165,15 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if
(
$tempPrice
){
$tempObj
[
'goodsPrice'
]
=
$tempPrice
;
}
$tempObj
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$pBundling
[
'image'
]);
$tempObj
[
'goodsList'
]
=
\Our\Common
::
convertUnderline
(
$pBundling
[
'goodsList'
]);
$tempObj
[
'goodsOriginalPrice'
]
=
$pBundling
[
'sumPrice'
];
}
else
if
(
$tempCart
[
'type'
]
==
\Our\ApiConst
::
addGoodsToCart
)
{
$goodsStorage
=
isset
(
$goodsCommonStorages
[
$tempCart
[
'goods_commonid'
]][
$tempCart
[
'goods_id'
]])
?
$goodsCommonStorages
[
$tempCart
[
'goods_commonid'
]][
$tempCart
[
'goods_id'
]]
:
array
();
//$goodsDao->getOnlineStorageGoods($tempCart['goods_id']);
if
(
$goodsStorage
){
if
(
isset
(
$goodsStorage
[
'goods_image'
])
&&
$goodsStorage
[
'goods_image'
]){
$tempObj
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goodsStorage
[
'goods_image'
]);
$tempObj
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goodsStorage
[
'goods_image'
]
,
\Our\ImageConst
::
cartBlImage
);
}
if
(
$goodsStorage
[
'onlineFlag'
]
==
\Our\ApiConst
::
one
)
{
if
(
$goodsStorage
[
'goodsStorage'
]
>
\Our\ApiConst
::
zero
){
...
...
@@ -353,6 +356,24 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
return
$return
;
}
public
function
getResizeGroupSaleGoodsList
(
$pbundingList
,
$blImageWidth
=
\Our\ImageConst
::
cartBlImage
,
$blDetailImageWidth
=
\Our\ImageConst
::
cartBlDetailImage
){
$groupList
=
array
();
foreach
(
$pbundingList
as
$k
=>
$v
){
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
],
$blImageWidth
);
if
(
$v
[
'goodsList'
]){
$goods
=
array
();
foreach
(
$v
[
'goodsList'
]
as
$v2
){
$v2
[
'goodsImage'
]
=
ImageUtil
::
getGoodsImgWithUrl
(
$v2
[
'goodsImage'
],
$blDetailImageWidth
);
$goods
[]
=
$v2
;
}
$v
[
'goodsList'
]
=
$goods
;
}
$groupList
[]
=
$v
;
}
return
$groupList
;
}
/**
* 获取组合销售与商品列表
* @param $param
...
...
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