new: add channel management
This commit is contained in:
@@ -21,12 +21,12 @@ class Deliveries
|
||||
$customer = $customerId ? Customers::get($customerId) : Customers::getAuth();
|
||||
$saleChannels = $customer ? $customer->sale_channels->pluck('id')->toArray() : [SaleChannels::getDefaultID()];
|
||||
|
||||
return $saleChannels ? self::getBySaleChannels($saleChannels) : false;
|
||||
return $saleChannels ? self::getBySaleChannels($saleChannels) : collect();
|
||||
}
|
||||
|
||||
public static function getBySaleChannels($saleChannels)
|
||||
{
|
||||
return Delivery::bySaleChannels($saleChannels)->with('sale_channel')->get();
|
||||
return Delivery::bySaleChannels($saleChannels)->active()->with('sale_channel')->get();
|
||||
}
|
||||
|
||||
public static function getSaleChannelId($deliveryId)
|
||||
@@ -41,7 +41,7 @@ class Deliveries
|
||||
|
||||
public static function getAllWithSaleChannel()
|
||||
{
|
||||
return Delivery::orderBy('name', 'asc')->active()->public()->with('sale_channel')->get();
|
||||
return Delivery::orderBy('name', 'asc')->active()->with('sale_channel')->get();
|
||||
}
|
||||
|
||||
public static function toggleActive($id, $active)
|
||||
|
||||
Reference in New Issue
Block a user