From c7bf98f3d1d97049878cadf9cbbf203070928a8e Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Sat, 7 Dec 2024 15:28:04 +0800 Subject: [PATCH] 0.88 --- app/api/logic/GoodsLogic.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/api/logic/GoodsLogic.php b/app/api/logic/GoodsLogic.php index 076a2150..df8efd54 100755 --- a/app/api/logic/GoodsLogic.php +++ b/app/api/logic/GoodsLogic.php @@ -1046,9 +1046,6 @@ class GoodsLogic extends Logic ->limit(4) ->select() ->toArray(); - foreach ($list as &$v) { - $v['min_price'] = round(0.88*$v['min_price'],2); - } $count = count($list); if ($count < 4) { @@ -1063,6 +1060,7 @@ class GoodsLogic extends Logic $result = array_merge($list, $goods); foreach ($result as $k => &$v) { + $v['min_price'] = round(0.88*$v['min_price'],2); if (isset($v['image'])) { $v['image'] = UrlServer::getFileUrl($v['image']); } @@ -1082,9 +1080,6 @@ class GoodsLogic extends Logic ->field('ng.id as ng_id, g.id as id, g.name, g.image, g.issuing_price, g.market_price, g.min_price, g.purchase_price, g.wholesale_price, g.subsidy_id') ->select() ->toArray(); - foreach ($list as &$v) { - $v['min_price'] = round(0.88*$v['min_price'],2); - } $goods = Db::name('goods') ->where($onSaleWhere) ->where($shopWhere) @@ -1100,6 +1095,7 @@ class GoodsLogic extends Logic $result = array_merge($list, $goods); foreach ($result as $k => &$v) { + $result[$k]['min_price'] = round(0.88*$v['min_price'],2); if (isset($v['image'])) { $v['image'] = UrlServer::getFileUrl($v['image']); }