商品推荐图片处理

feat/task1-c-wallet
gongfuxiang 2019-03-03 21:07:02 +08:00
parent ec45902ce1
commit 9a77cf3906
1 changed files with 16 additions and 2 deletions

View File

@ -285,8 +285,22 @@ class GoodsService
// 商品首页推荐图片,不存在则使用商品封面图片
if(isset($v['home_recommended_images']))
{
$v['home_recommended_images_old'] = $v['home_recommended_images'];
$v['home_recommended_images'] = ResourcesService::AttachmentPathViewHandle($v['home_recommended_images']);
if(empty($v['home_recommended_images']))
{
if(isset($v['images']))
{
$v['home_recommended_images'] = $v['images'];
} else {
if(!empty($v['id']))
{
$images = Db::name('Goods')->where(['id'=>$v['id']])->value('images');
$v['home_recommended_images'] = ResourcesService::AttachmentPathViewHandle($images);
}
}
} else {
$v['home_recommended_images_old'] = $v['home_recommended_images'];
$v['home_recommended_images'] = ResourcesService::AttachmentPathViewHandle($v['home_recommended_images']);
}
}
// PC内容处理