fix shipping
This commit is contained in:
@@ -58,9 +58,9 @@ class Category extends parentCategory
|
||||
return $this->tags()->withCount('Articles');
|
||||
}
|
||||
|
||||
public function scopeByCategory($query, $category_id)
|
||||
public function scopeByCategory($query, $categoryId)
|
||||
{
|
||||
return $query->where('category_id', $category_id);
|
||||
return $query->where('category_id', $categoryId);
|
||||
}
|
||||
|
||||
public function scopeVisible($query)
|
||||
@@ -78,28 +78,28 @@ class Category extends parentCategory
|
||||
return $query->where('id', '<>', 1);
|
||||
}
|
||||
|
||||
public function scopeInRange($query, $_lft, $_rgt)
|
||||
public function scopeInRange($query, $left, $right)
|
||||
{
|
||||
return $query->where('_lft', '>=', $_lft)->where('_rgt', '<=', $_rgt);
|
||||
return $query->where('_lft', '>=', $left)->where('_rgt', '<=', $right);
|
||||
}
|
||||
|
||||
public function scopeHasAvailableOffers($query, $sale_channel_id = false)
|
||||
public function scopeHasAvailableOffers($query, $saleChannelId = false)
|
||||
{
|
||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
||||
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
||||
|
||||
return $query->whereHas('articles', function ($query) use ($sale_channel_id) {
|
||||
$query->WithAvailableOffers($sale_channel_id);
|
||||
return $query->whereHas('articles', function ($query) use ($saleChannelId) {
|
||||
$query->WithAvailableOffers($saleChannelId);
|
||||
});
|
||||
}
|
||||
|
||||
public function scopeHasAvailableOffersByCategoryParent($query, $sale_channel_id = false)
|
||||
public function scopeHasAvailableOffersByCategoryParent($query, $saleChannelId = false)
|
||||
{
|
||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
||||
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
||||
|
||||
return $query->whereHas('articles', function ($query) use ($sale_channel_id) {
|
||||
$query->WithAvailableOffers($sale_channel_id);
|
||||
})->orWhereHas('descendants.articles', function ($query) use ($sale_channel_id) {
|
||||
$query->WithAvailableOffers($sale_channel_id);
|
||||
return $query->whereHas('articles', function ($query) use ($saleChannelId) {
|
||||
$query->WithAvailableOffers($saleChannelId);
|
||||
})->orWhereHas('descendants.articles', function ($query) use ($saleChannelId) {
|
||||
$query->WithAvailableOffers($saleChannelId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,14 +58,14 @@ class Order extends Model
|
||||
return $query->where('uuid', $uuid);
|
||||
}
|
||||
|
||||
public function scopeByCustomer($query, $customer_id)
|
||||
public function scopeByCustomer($query, $customerId)
|
||||
{
|
||||
return $query->where('customer_id', $customer_id);
|
||||
return $query->where('customer_id', $customerId);
|
||||
}
|
||||
|
||||
public function scopeByDelivery($query, $delivery_id)
|
||||
public function scopeByDelivery($query, $deliveryId)
|
||||
{
|
||||
return $query->where('delivery_id', $delivery_id);
|
||||
return $query->where('delivery_id', $deliveryId);
|
||||
}
|
||||
|
||||
public function scopePreparation($query)
|
||||
@@ -88,9 +88,9 @@ class Order extends Model
|
||||
return $query->where('status', $status);
|
||||
}
|
||||
|
||||
public function scopeByPaymentType($query, $payment_type)
|
||||
public function scopeByPaymentType($query, $paymentType)
|
||||
{
|
||||
return $query->where('payment_type', $payment_type);
|
||||
return $query->where('payment_type', $paymentType);
|
||||
}
|
||||
|
||||
public function scopeByPeriod($query, $start, $end, $field = 'created_at')
|
||||
|
||||
Reference in New Issue
Block a user