This commit is contained in:
xucong 2024-12-07 15:28:04 +08:00
parent 0776d3d3b6
commit c7bf98f3d1

@ -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']);
}