From a33d0e3b520bd70a6b2d9b0d480999ab7c09c2d5 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Fri, 22 Nov 2024 15:49:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=94=9F=E6=B4=BB=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=BF=94=E8=A1=A5=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/LocalStoreGoodsLogic.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/api/logic/LocalStoreGoodsLogic.php b/app/api/logic/LocalStoreGoodsLogic.php index 0238d8ce..2097ca5a 100644 --- a/app/api/logic/LocalStoreGoodsLogic.php +++ b/app/api/logic/LocalStoreGoodsLogic.php @@ -57,7 +57,7 @@ class LocalStoreGoodsLogic extends Logic $m_where[] = ['delete_time', '=', 0]; $list = LocalStoreGoods::with(['pic', 'item']) - ->field('id, lstore_id, title, price, is_multiple_spec') + ->field('id, lstore_id, title, price, is_multiple_spec, subsidy_id') ->where($where) ->where($m_where) ->order($order) @@ -65,6 +65,12 @@ class LocalStoreGoodsLogic extends Logic ->select() ->toArray(); + foreach ($list as $k => $v) { + // 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID + $list[$k]['subsidy'] = (new GoodsSubsidy())->getSubsidyById($v['subsidy_id'] > 0 ? $v['subsidy_id'] : 4); + $list[$k]['subsidy_txt'] = '最高返' . $list[$k]['subsidy']['subsidy']; + } + if ($get['lstore_id'] == Config::get('localstore.dlh_lstore_id')) { foreach ($list as $k => &$v) { // $list[$k]['original_price'] = $v['price'];