|
|
|
|
|
|
|
|
// abonnements manquants |
|
|
// abonnements manquants |
|
|
$arraySubscriptions = Subscription::searchByDate($date); |
|
|
$arraySubscriptions = Subscription::searchByDate($date); |
|
|
$json['missing_subscriptions'] = [] ; |
|
|
$json['missing_subscriptions'] = [] ; |
|
|
foreach ($arraySubscriptions as $subscription) { |
|
|
|
|
|
if (!$subscription->hasOrderAlreadyExist($ordersArrayObject)) { |
|
|
|
|
|
$json['missing_subscriptions'][] = [ |
|
|
|
|
|
'username' => $subscription->getUsername() |
|
|
|
|
|
] ; |
|
|
|
|
|
|
|
|
if($distribution->active) { |
|
|
|
|
|
foreach ($arraySubscriptions as $subscription) { |
|
|
|
|
|
if(!$subscription->hasOrderAlreadyExist($ordersArrayObject) |
|
|
|
|
|
&& $subscription->productSubscription && count($subscription->productSubscription)) { |
|
|
|
|
|
|
|
|
|
|
|
$json['missing_subscriptions'][] = [ |
|
|
|
|
|
'username' => $subscription->getUsername() |
|
|
|
|
|
] ; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |