1
0
Fork 0

fix fast buy card

main
A1Gard 1 year ago
parent efc74948da
commit 841250f3c9

@ -663,8 +663,10 @@ class WebsiteController extends Controller
->get(); ->get();
foreach ($qs as $q){ foreach ($qs as $q){
$p = Product::whereId($q->product_id)->first(); $p = Product::whereId($q->product_id)->first();
$p->stock_quantity = $q->count; if ($p != null){
$p->save(); $p->stock_quantity = $q->count;
$p->save();
}
} }
return 'Done!'; return 'Done!';
} }

@ -1,7 +1,7 @@
<div class="quantity @if($pro->getPurePriceDef($q->price) == $pro->getPurePrice()) active @endif" <div class="quantity @if($index == 0) active @endif"
data-price="{{$pro->getPurePriceDef($q->price)}}" data-price="{{$pro->getPurePriceDef($q->price)}}"
data-count="{{$q->count}}"> data-count="{{$q->count}}">
<input type="checkbox" name="data[{{$pro->id}}]" value='{{$q}}' @if($pro->getPurePriceDef($q->price) == $pro->getPurePrice()) checked @endif> <input type="checkbox" name="data[{{$pro->id}}]" value='{{$q}}' @if($index == 0) checked @endif>
@foreach(\App\Helpers\jsonOrder( $q->data ) as $k => $meta) @foreach(\App\Helpers\jsonOrder( $q->data ) as $k => $meta)
@if($k != 'color' && $k != 'count' && $k != 'price') @if($k != 'color' && $k != 'count' && $k != 'price')
<span> <span>

@ -68,9 +68,9 @@
</td> </td>
<td colspan="2"> <td colspan="2">
@if($pro->quantities()->sum('count') > 0) @if($pro->quantities()->sum('count') > 0)
@foreach($pro->quantities as $q) @foreach($pro->quantities as $index => $q)
@if($q->count > 0) @if($q->count > 0)
@include('component.card-quantity',compact('q','pro')) @include('component.card-quantity',compact('q','pro','$index'))
@endif @endif
@endforeach @endforeach
@else @else

Loading…
Cancel
Save