Add no visual
This commit is contained in:
@@ -40,6 +40,7 @@ class OffersDataTable extends DataTable
|
||||
})
|
||||
->editColumn('status_id', function (Offer $offer) {
|
||||
return view("components.form.toggle", [
|
||||
'name' => 'status_id',
|
||||
'value' => $offer->status_id,
|
||||
'on' => __('active'),
|
||||
'off' => __('inactive'),
|
||||
|
||||
@@ -77,7 +77,7 @@ class OfferController extends Controller
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = Offers::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
$data = Offers::toggle_active($request->input('id'), ($request->input('status_id') == 'true') ? 1 : 0);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ class Article extends Model implements HasMedia
|
||||
public function scopeWithAvailableOffers($query)
|
||||
{
|
||||
return $query->whereHas('offers', function ($query) {
|
||||
$query->where('status_id', 1);
|
||||
$query->byStatus(1);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class Offers
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Offer::orderBy('value', 'asc')->get();
|
||||
return Offer::get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
@@ -77,9 +77,9 @@ class Offers
|
||||
return Offer::destroy($id);
|
||||
}
|
||||
|
||||
public static function toggle_active($id, $active)
|
||||
public static function toggle_active($id, $status_id)
|
||||
{
|
||||
return self::update(['status_id' => $active], $id);
|
||||
return self::update(['status_id' => $status_id], $id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
build/img/visuel-non-disponible.jpg
Normal file
BIN
build/img/visuel-non-disponible.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -1,6 +1,10 @@
|
||||
<a href="{{ route('Shop.Articles.show', ['id' => $article['semences']['article_id'] ?? false ]) }}">
|
||||
<div class="card">
|
||||
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="...">
|
||||
@if ($article['image'] !== null)
|
||||
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="{{ $article['product_name'] }}">
|
||||
@else
|
||||
<img src="img/visuel-non-disponible.jpg" class="card-img-top">
|
||||
@endif
|
||||
<div class="card-body">
|
||||
<div class="row card-title">
|
||||
<div class="col-10" style="font-weight: bold; color: green;">
|
||||
|
||||
Reference in New Issue
Block a user