Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- <?php
-
- namespace console\commands;
-
- use common\logic\Distribution\Distribution\Module\DistributionModule;
- use common\logic\Producer\Producer\Module\ProducerModule;
- use yii\console\Controller;
-
- class ActiveDistributionsInAdvanceController extends Controller
- {
- public function actionIndex()
- {
- $producerModule = ProducerModule::getInstance();
- $distributionModule =DistributionModule::getInstance();
-
- $producersArray = $producerModule->findProducersActive();
- foreach($producersArray as $producer) {
- \Yii::$app->logic->setProducerContext($producer);
- $weeksDistributionsActivatedInAdvance = $producerModule->getConfig('option_weeks_distributions_activated_in_advance');
- if($weeksDistributionsActivatedInAdvance) {
- $date = new \DateTime('+'.$weeksDistributionsActivatedInAdvance.' weeks');
- $distributionModule->activeDistributionByDate($date);
- }
- }
- }
- }
-
- ?>
|