lqmac 3 months ago
parent 892a1463e5
commit 1f65eb8771
  1. 13
      app/api/controller/Goods.php

@ -85,17 +85,26 @@ class Goods extends Controller
if ($goodsInfo['channel'] == 'sn') {
$goodsInfo['link'] = "";
}
//获取商户id
//获取商户id-兼容有上级商城的商城
if ($this->storeInfo->p_store_id) {
$merchantId = 0;
$storeId = $this->storeId;
} else {
$merchantId = $goodsInfo['merchant_id'];
$storeId = $goodsInfo['store_id'];
}
//获取客服设置
$service = new SettingService;
$setting = $service->getGoodsCustomer($merchantId,$storeId);
$goodsInfo['setting'] = $setting;
//京东短链
//京东短链-非小程序终端不需要京东短链
if (request()->header()['platform'] == "MP-WEIXIN") {
$jd = new Jd();
$jd_short_url = $jd->getJdShortLink($goodsInfo['goods_no']);
}
//获取商品短链
$goodsInfo['jd_short_url'] = $jd_short_url[0]['link'] ?? "";
return $this->renderSuccess(['detail' => $goodsInfo]);

Loading…
Cancel
Save