fix fast buy card

pull/1/head
A1Gard 1 year ago
parent efc74948da
commit 841250f3c9

@ -663,9 +663,11 @@ 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();
if ($p != null){
$p->stock_quantity = $q->count; $p->stock_quantity = $q->count;
$p->save(); $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