From 9a77cf3906760f08ab5ad34487f27a7b7bcea1e7 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sun, 3 Mar 2019 21:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=8E=A8=E8=8D=90=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/GoodsService.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/application/service/GoodsService.php b/application/service/GoodsService.php index f89269570..d3c2c3fa8 100755 --- a/application/service/GoodsService.php +++ b/application/service/GoodsService.php @@ -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内容处理