Sfoglia il codice sorgente

Import des abonnements lors de l'activation d'un jour de distribution

refactoring
parent
commit
60ff87dc80
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. +6
    -0
      backend/controllers/DistributionController.php

+ 6
- 0
backend/controllers/DistributionController.php Vedi File

@@ -44,6 +44,7 @@ use common\models\Product ;
use common\models\Producer ;
use common\models\Order ;
use common\models\User ;
use common\models\Subscription ;
use DateTime;

class DistributionController extends BackendController
@@ -357,6 +358,11 @@ class DistributionController extends BackendController
$distribution->active = (int) $active ;
$distribution->save() ;
if ($active) {
// ajout des abonnements
Subscription::addAll($distribution->date);
}
return ['success'] ;
}
}

Loading…
Annulla
Salva