From fb5cfb4dd87d2a5ad71d0f9958b37e073220ccbc Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Tue, 19 Nov 2024 23:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=95=86=E5=93=81=E8=BF=94=E6=AF=94=E6=96=87?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/MallNewsLogic.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/api/logic/MallNewsLogic.php b/app/api/logic/MallNewsLogic.php index c783b758..5f2bccc6 100755 --- a/app/api/logic/MallNewsLogic.php +++ b/app/api/logic/MallNewsLogic.php @@ -4,6 +4,7 @@ namespace app\api\logic; use app\common\basics\Logic; use app\common\model\goods\Goods; +use app\common\model\goods\GoodsSubsidy; use app\common\server\UrlServer; use think\facade\Config; use think\facade\Db; @@ -49,7 +50,10 @@ class MallNewsLogic extends Logic if ($mall_type == 1) { $mall_news = MallNewsShop::where(['id' => $id, 'delete_time' => 0])->find()->toArray(); if ($mall_news['shop_id'] > 0) { - $mall_news['shop'] = Goods::where(['id' => $mall_news['shop_id']])->field('name, image, min_price')->find()->toArray(); + $mall_news['shop'] = Goods::where(['id' => $mall_news['shop_id']])->field('name, image, min_price, subsidy_id')->find()->toArray(); + // 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID + $mall_news['subsidy'] = (new GoodsSubsidy())->getSubsidyById($mall_news['shop']['subsidy_id'] > 0 ? $mall_news['shop']['subsidy_id'] : 4); + $mall_news['subsidy_txt'] = '最高返' . $mall_news['subsidy']['subsidy']; } $file = MallNewsFile::where(['mall_news_shop_id' => $id])->field('mall_news_shop_id, src')->select()->toArray(); @@ -65,6 +69,9 @@ class MallNewsLogic extends Logic if ($mall_news['shop_id'] > 0) { $mall_news['shop'] = Goods::where(['id' => $mall_news['shop_id']])->field('name, image, min_price')->find()->toArray(); + // 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID + $mall_news['subsidy'] = (new GoodsSubsidy())->getSubsidyById($mall_news['shop']['subsidy_id'] > 0 ? $mall_news['shop']['subsidy_id'] : 4); + $mall_news['subsidy_txt'] = '最高返' . $mall_news['subsidy']['subsidy']; } if (isset($mall_news['files'])) {