01 2022 Microsite Promotion

This commit is contained in:
Kevin Adametz 2022-01-18 18:30:14 +01:00
parent 3f1fb9377d
commit 38e7fd504a
39 changed files with 761 additions and 336 deletions

View file

@ -80,6 +80,13 @@ class Shipping extends Model
}
public function getShippingPricesBy($shipping_for){
return $this->hasMany('App\Models\ShippingPrice', 'shipping_id', 'id')->where('shipping_for', $shipping_for);
return ShippingPrice::where('shipping_id', $this->id)->where('shipping_for', $shipping_for)->get();
}
public function getShippingPricesFirstBy($shipping_for){
return ShippingPrice::where('shipping_id', $this->id)->where('shipping_for', $shipping_for) ->orderBy('price', 'ASC')->first();
}
}