zengyyh 3 months ago
parent 53a5328f64
commit 0606193508
  1. 8
      app/api/controller/Goods.php
  2. 7
      app/store/controller/Goods.php

@ -564,7 +564,7 @@ class Goods extends Controller
{
$id = $this->request->param('id');
$detail = ModelTipoff::where('id',$id)->find();
$goodsList = GoodsModel::whereIn("goods_id",$detail['goods_id'])->field('goods_id,goods_name,goods_price_min,cost_price_min,goods_no')->select();
$goodsList = GoodsModel::whereIn("goods_id",$detail['goods_id'])->field('goods_id,goods_name,goods_price_min,cost_price_min,goods_no,link')->select();
$goods_no = [];
$JdModel = new jd();
@ -576,7 +576,11 @@ class Goods extends Controller
foreach ($goodsList as $key => &$value) {
$cates = GoodsCategoryRel::where('goods_id', $value['goods_id'])->select()->toArray();
$value['jd_short_url'] = $jd_url[$value['goods_no']]['link'] ?? "";
$value['jd_short_url'] = $jd_url[$value['goods_no']]['link'];
if(empty($value['jd_short_url'])){
$value['jd_short_url'] = $value['link'];
}
//分类
if ($cates) {
//会员价

@ -697,7 +697,7 @@ class Goods extends Controller
{
$id = $this->request->param('id');
$detail = ModelTipoff::where('id',$id)->find();
$goodsList = GoodsModel::whereIn("goods_id",$detail['goods_id'])->field('goods_id,goods_name,goods_price_min,cost_price_min,goods_no')->select();
$goodsList = GoodsModel::whereIn("goods_id",$detail['goods_id'])->field('goods_id,goods_name,goods_price_min,cost_price_min,goods_no,link')->select();
$goods_no = [];
$JdModel = new jd();
@ -709,7 +709,10 @@ class Goods extends Controller
foreach ($goodsList as $key => &$value) {
$cates = GoodsCategoryRel::where('goods_id', $value['goods_id'])->select()->toArray();
$value['jd_short_url'] = $jd_url[$value['goods_no']]['link'] ?? "";
$value['jd_short_url'] = $jd_url[$value['goods_no']]['link'];
if(empty($value['jd_short_url'])){
$value['jd_short_url'] = $value['link'];
}
//分类
if ($cates) {
//会员价

Loading…
Cancel
Save