Parcourir la source

[backend] Distributions : gestion des abonnements manquants

refactoring
Guillaume il y a 3 ans
Parent
révision
e48a7fb910
1 fichiers modifiés avec 9 ajouts et 5 suppressions
  1. +9
    -5
      backend/controllers/DistributionController.php

+ 9
- 5
backend/controllers/DistributionController.php Voir le fichier

@@ -363,11 +363,15 @@ class DistributionController extends BackendController
// abonnements manquants
$arraySubscriptions = Subscription::searchByDate($date);
$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()
] ;
}
}
}
}

Chargement…
Annuler
Enregistrer