lqmac 7 months ago
parent 01b807f044
commit 33d6a9c0c7
  1. 7
      app/api/model/Goods.php

@ -330,6 +330,7 @@ class Goods extends GoodsModel
$jd = new \app\common\service\Jd(); $jd = new \app\common\service\Jd();
$res = $jd->getGoodsMainImageAndDetail($goodsInfo->goods_no); $res = $jd->getGoodsMainImageAndDetail($goodsInfo->goods_no);
if ($res) { if ($res) {
if ($res['mainImageList']) {
$goods_images = []; $goods_images = [];
foreach ($res['mainImageList'] as $seq => $image) { foreach ($res['mainImageList'] as $seq => $image) {
$goods_images[] = [ $goods_images[] = [
@ -341,12 +342,18 @@ class Goods extends GoodsModel
} }
$goodsInfo->goods_images = $goods_images; $goodsInfo->goods_images = $goods_images;
$goodsInfo->goods_image = $res['mainImageList'][0]; $goodsInfo->goods_image = $res['mainImageList'][0];
}
if ($res['infoImageList']) {
$content = ""; $content = "";
foreach ($res['infoImageList'] as $value) { foreach ($res['infoImageList'] as $value) {
$content .= '<p><img src="' . $value . '"/></p>'; $content .= '<p><img src="' . $value . '"/></p>';
} }
$goodsInfo->content = $content; $goodsInfo->content = $content;
} }
}
break; break;
case 'sn': case 'sn':
// code... // code...

Loading…
Cancel
Save