Commit a140629a authored by liuyuzhen's avatar liuyuzhen

Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into lyz

parents 75b902b5 c70323d6
...@@ -104,5 +104,7 @@ class ImageConst{ ...@@ -104,5 +104,7 @@ class ImageConst{
const storeQualificationImg = 188; const storeQualificationImg = 188;
const storeCollectionImg = 112; const storeCollectionImg = 112;
const homeIndexHotGoodsImageSize =250; const homeIndexHotGoodsImageSize =250;
const goodsStoreImg = 100; //商品详情页的店铺头像
const goodsGroupImg = 182;//商品/组合详情页的其他搭配图片
const groupGoodsImg = 160; //组合详情页的搭配商品
} }
...@@ -126,10 +126,17 @@ class ImageUtil { ...@@ -126,10 +126,17 @@ class ImageUtil {
//$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334'; //$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334';
} }
$goodsImg = \Our\Common::getStaticFile($goodsImg,$directory); $goodsImg = \Our\Common::getStaticFile($goodsImg,$directory);
if($width > 0) {
$goodsImg .= "?x-oss-process=image/resize,m_fill,h_{$height},w_{$width}"; $goodsImg .= "?x-oss-process=image/resize,m_fill,h_{$height},w_{$width}";
}
return $goodsImg; 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){ public static function getTopClassAdvImageUrl($gcId){
$fileName = \Our\ImageConst::topClassAdvImagePrefis.$gcId.\Our\NameConst::jpgSuffix; $fileName = \Our\ImageConst::topClassAdvImagePrefis.$gcId.\Our\NameConst::jpgSuffix;
$gcImageUrl = \Our\Common::getStaticFile($fileName,\Our\ImageConst::defaultPath); $gcImageUrl = \Our\Common::getStaticFile($fileName,\Our\ImageConst::defaultPath);
......
...@@ -524,7 +524,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -524,7 +524,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$commonInstance = \DAO\GoodsCommonModel::getInstance(); $commonInstance = \DAO\GoodsCommonModel::getInstance();
$count = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonInstance, 'getCount'),array(array('store_id'=>$storeId)),\Our\ApiConst::oneDaySecond); $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']);
} }
/** /**
......
...@@ -50,6 +50,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -50,6 +50,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$data['goods'] = []; $data['goods'] = [];
if($data['goodsList'] && is_array($data['goodsList'])){ if($data['goodsList'] && is_array($data['goodsList'])){
foreach ($data['goodsList'] as $v){ foreach ($data['goodsList'] as $v){
$v['goodsImage'] = \Our\ImageUtil::getGoodsImgWithUrl($v['goodsImage'],\Our\ImageConst::groupGoodsImg);
unset($v['goods_id']); unset($v['goods_id']);
unset($v['goodsStorage']); unset($v['goodsStorage']);
unset($v['goodsAttr']); unset($v['goodsAttr']);
...@@ -227,7 +228,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -227,7 +228,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if($groupList){ if($groupList){
foreach ($groupList as $k=>$v){ foreach ($groupList as $k=>$v){
$v['groupId'] = $v['blId']; $v['groupId'] = $v['blId'];
$v['image'] = ImageUtil::getGoodsImgUrl($v['image']); $v['image'] = ImageUtil::getGoodsImgUrl($v['image'],\our\ImageConst::goodsGroupImg);
unset($v['goodsList']); unset($v['goodsList']);
unset($v['bl_title']); unset($v['bl_title']);
unset($v['store_id']); unset($v['store_id']);
...@@ -295,7 +296,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -295,7 +296,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach ($group as $k=>$v){ foreach ($group as $k=>$v){
if($v['bl_quota_starttime']<TIMESTAMP&&$v['endTime']>=TIMESTAMP){ if($v['bl_quota_starttime']<TIMESTAMP&&$v['endTime']>=TIMESTAMP){
$v['groupId'] = $v['blId']; $v['groupId'] = $v['blId'];
$v['image'] = ImageUtil::getGoodsImgUrl($v['image']); $v['image'] = ImageUtil::getGoodsImgUrl($v['image'],\Our\ImageConst::goodsGroupImg);
unset($v['goodsList']); unset($v['goodsList']);
unset($v['bl_title']); unset($v['bl_title']);
unset($v['store_id']); unset($v['store_id']);
...@@ -469,7 +470,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -469,7 +470,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$goods_temp = array_merge($goods,$goodsArray[$goods['goods_id']]); $goods_temp = array_merge($goods,$goodsArray[$goods['goods_id']]);
$blSumPrice += $goods_temp['goodsPrice']*$goods_temp['num']; $blSumPrice += $goods_temp['goodsPrice']*$goods_temp['num'];
$goods_temp['goodsAttr'] = $goodsDao->getFormatGoodsAttr($goods_temp['goods_spec']); $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_spec']);
//unset($goods_temp['goods_image']); //unset($goods_temp['goods_image']);
//unset($goods_temp['bl_id']); //unset($goods_temp['bl_id']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment