From 7568e338a937d9f7bd7fe7fead24924f827eb680 Mon Sep 17 00:00:00 2001 From: zengyyh Date: Fri, 25 Oct 2024 00:34:41 +0800 Subject: [PATCH 1/2] 123 --- app/api/controller/Goods.php | 2 +- app/store/controller/Goods.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index cfe64d9e..0c2ef10d 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -576,7 +576,7 @@ 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'] ??$value['link']; //分类 if ($cates) { //会员价 diff --git a/app/store/controller/Goods.php b/app/store/controller/Goods.php index ee24e063..d014431d 100644 --- a/app/store/controller/Goods.php +++ b/app/store/controller/Goods.php @@ -658,7 +658,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(); @@ -670,7 +670,7 @@ 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'] ?? $value['link']; //分类 if ($cates) { //会员价 From aa7d10c57a287d942163c0b25a1104cd922d488c Mon Sep 17 00:00:00 2001 From: zyh Date: Fri, 1 Nov 2024 18:01:33 +0800 Subject: [PATCH 2/2] 1 --- app/api/model/Goods.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/api/model/Goods.php b/app/api/model/Goods.php index efb9fb73..bafca674 100644 --- a/app/api/model/Goods.php +++ b/app/api/model/Goods.php @@ -744,10 +744,11 @@ class Goods extends GoodsModel //价格判断 if (UserService::isstore()) { $priceArr = \app\common\model\PriceSet::distributionPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds); + $goods_price_min = $goods['goods_price_min']; $goods['goods_price_min_plus'] = $priceArr['membershipPrice']; $goods['goods_price_min_dealer'] = $priceArr['distributionPrice']; $goods['goods_price_min'] = $goods['goods_price_min_plus'];//$goods['cost_price_min'];//店长售价,展示为成本价 - $goods['discount'] = bcdiv((string)($priceArr['distributionPrice'] * 10), (string)$goods['goods_price_min'], 1); + $goods['discount'] = bcdiv((string)($priceArr['membershipPrice'] * 10), (string)$goods_price_min, 1); } elseif (UserService::isPlusMember()) { $membershipPrice = \app\common\model\PriceSet::membershipPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds); $goods['discount'] = bcdiv((string)($membershipPrice * 10), (string)$goods['goods_price_min'], 1);