|
|
|
|
|
|
|
|
use common\models\Producer ; |
|
|
use common\models\Producer ; |
|
|
use common\models\Order ; |
|
|
use common\models\Order ; |
|
|
use common\models\User ; |
|
|
use common\models\User ; |
|
|
|
|
|
use common\models\Subscription ; |
|
|
use DateTime; |
|
|
use DateTime; |
|
|
|
|
|
|
|
|
class DistributionController extends BackendController |
|
|
class DistributionController extends BackendController |
|
|
|
|
|
|
|
|
$distribution->active = (int) $active ; |
|
|
$distribution->active = (int) $active ; |
|
|
$distribution->save() ; |
|
|
$distribution->save() ; |
|
|
|
|
|
|
|
|
|
|
|
if ($active) { |
|
|
|
|
|
// ajout des abonnements |
|
|
|
|
|
Subscription::addAll($distribution->date); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return ['success'] ; |
|
|
return ['success'] ; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |