Browse Source

去掉不可用券中重复的券

master
weigang 6 years ago
parent
commit
27f5fa8962
  1. 4
      app/Controller/CouponController.php

4
app/Controller/CouponController.php

@ -241,7 +241,7 @@ class CouponController extends BaseController
$notAvailable = []; $notAvailable = [];
foreach ($data as $key => &$item) { foreach ($data as $key => &$item) {
if (in_array($item->id, $couponIds)) { if (in_array($item->id, $couponIds)) {
$notAvailable[] = $item;
$notAvailable[$item->id] = $item;
} else { } else {
$available[] = $item; $available[] = $item;
} }
@ -249,7 +249,7 @@ class CouponController extends BaseController
return $this->success([ return $this->success([
'available' => $available, 'available' => $available,
'not_available' => $notAvailable
'not_available' => array_values($notAvailable)
]); ]);
} }

Loading…
Cancel
Save