|
@@ -468,7 +468,10 @@ class Purchase extends Controller
|
|
|
->with(['items','items.offers','items.offers.user'])
|
|
|
->findOrFail($data['id']);
|
|
|
foreach ($model['items'] as &$v){
|
|
|
- foreach ($v['offers'] as &$a){
|
|
|
+ foreach ($v['offers'] as $aa=>&$a){
|
|
|
+ if($a['id']!=$v['offer_id']){
|
|
|
+ unset($v['offers'][$aa]);
|
|
|
+ }
|
|
|
$a['amounts'] = ShopPurchaseOfferAmount::mk()
|
|
|
->where('user_id',$a['user_id'])
|
|
|
->where('offer_id',$a['id'])
|