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'],