From e371179fafcc3c7cb86aa11ef81aac5c9892c4c6 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 22 Mar 2024 16:57:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A2=9E=E6=94=B6=E8=A1=A5?= =?UTF-8?q?=E8=B4=B4=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/server/Store.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controller/api/server/Store.php b/app/controller/api/server/Store.php index 3f9bf5a3..4dc7ea30 100644 --- a/app/controller/api/server/Store.php +++ b/app/controller/api/server/Store.php @@ -200,9 +200,9 @@ class Store extends BaseController $record = $query->page($page)->limit($limit)->order('id', 'desc')->select()->toArray(); if ($type == 2) { $merchantTypeId = Merchant::where('mer_id', $this->merId)->value('type_id'); - $first = $record[0] ?? ['coupon_price' => 0]; + $first = $record[0] ?? ['coupon_price' => 0, 'extra' => ['sale_target' => 0]]; foreach ($coupon['config'] as $item) { - if (in_array($merchantTypeId, $item['type_id']) && $item['subsidy'] > $first['coupon_price']) { + if (in_array($merchantTypeId, $item['type_id']) && $item['amount'] > $first['extra']['sale_target']) { array_unshift($record, [ 'id' => 0, 'coupon_price' => $item['subsidy'],