adjust deliveries by customer
This commit is contained in:
@@ -19,15 +19,15 @@ class Deliveries
|
||||
|
||||
public static function getByCustomer($customerId = false)
|
||||
{
|
||||
$customer = Customers::get($customerId);
|
||||
$saleChannels = $customer->sale_channels->pluck('id')->toArray();
|
||||
$customer = $customerId ? Customers::get($customerId) : Customers::getAuth();
|
||||
$saleChannels = $customer ? $customer->sale_channels->pluck('id')->toArray() : false;
|
||||
|
||||
return self::getBySaleChannels($saleChannels);
|
||||
return $saleChannels ? self::getBySaleChannels($saleChannels) : false;
|
||||
}
|
||||
|
||||
public static function getBySaleChannels($saleChannels)
|
||||
{
|
||||
return Delivery::bySaleChannels($saleChannels)->get();
|
||||
return Delivery::bySaleChannels($saleChannels)->with('sale_channel')->get();
|
||||
}
|
||||
|
||||
public static function getSaleChannelId($deliveryId)
|
||||
|
||||
Reference in New Issue
Block a user