mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 20:26:56 -04:00
minor fixes
This commit is contained in:
parent
783e3bb632
commit
ba8759af6f
@ -354,6 +354,8 @@ class SubscriptionController extends BaseController
|
|||||||
|
|
||||||
event(new SubscriptionWasUpdated($subscription, $subscription->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new SubscriptionWasUpdated($subscription, $subscription->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
|
||||||
|
nlog($subscription->id);
|
||||||
|
|
||||||
return $this->itemResponse($subscription);
|
return $this->itemResponse($subscription);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,7 +777,15 @@ class SubscriptionService
|
|||||||
*/
|
*/
|
||||||
public function products()
|
public function products()
|
||||||
{
|
{
|
||||||
return Product::whereIn('id', $this->transformKeys(explode(",", $this->subscription->product_ids)))->get();
|
if(!$this->subscription->product_ids)
|
||||||
|
return collect();
|
||||||
|
|
||||||
|
$keys = $this->transformKeys(explode(",", $this->subscription->product_ids));
|
||||||
|
|
||||||
|
if(is_array($keys))
|
||||||
|
return Product::whereIn('id', $keys)->get();
|
||||||
|
else
|
||||||
|
return Product::where('id', $keys)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -788,7 +796,18 @@ class SubscriptionService
|
|||||||
*/
|
*/
|
||||||
public function recurring_products()
|
public function recurring_products()
|
||||||
{
|
{
|
||||||
return Product::whereIn('id', $this->transformKeys(explode(",", $this->subscription->recurring_product_ids)))->get();
|
if(!$this->subscription->recurring_product_ids)
|
||||||
|
return collect();
|
||||||
|
|
||||||
|
$keys = $this->transformKeys(explode(",", $this->subscription->recurring_product_ids));
|
||||||
|
|
||||||
|
if(is_array($keys)){
|
||||||
|
return Product::whereIn('id', $keys)->get();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return Product::where('id', $keys)->get();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user