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

@ -330,22 +330,29 @@ class Goods extends GoodsModel
$jd = new \app\common\service\Jd();
$res = $jd->getGoodsMainImageAndDetail($goodsInfo->goods_no);
if ($res) {
$goods_images = [];
foreach ($res['mainImageList'] as $seq => $image) {
$goods_images[] = [
'file_id' => $seq,
'file_type' => 10,
'preview_url' => $image,
'external_url' => $image,
];
if ($res['mainImageList']) {
$goods_images = [];
foreach ($res['mainImageList'] as $seq => $image) {
$goods_images[] = [
'file_id' => $seq,
'file_type' => 10,
'preview_url' => $image,
'external_url' => $image,
];
}
$goodsInfo->goods_images = $goods_images;
$goodsInfo->goods_image = $res['mainImageList'][0];
}
$goodsInfo->goods_images = $goods_images;
$goodsInfo->goods_image = $res['mainImageList'][0];
$content = "";
foreach ($res['infoImageList'] as $value) {
$content .= '<p><img src="' . $value . '"/></p>';
if ($res['infoImageList']) {
$content = "";
foreach ($res['infoImageList'] as $value) {
$content .= '<p><img src="' . $value . '"/></p>';
}
$goodsInfo->content = $content;
}
$goodsInfo->content = $content;
}
break;
case 'sn':

Loading…
Cancel
Save