You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 satır
818B

  1. <?php
  2. namespace console\commands;
  3. use common\logic\Distribution\Distribution\Wrapper\DistributionManager;
  4. use common\logic\Producer\Producer\Wrapper\ProducerManager;
  5. use yii\console\Controller;
  6. class DemoAccountController extends Controller
  7. {
  8. public function actionIndex()
  9. {
  10. $producerManager = ProducerManager::getInstance();
  11. $distributionManager = DistributionManager::getInstance();
  12. $producerDemo = $producerManager->findOneProducerDemoAccount();
  13. \Yii::$app->logic->setProducerContext($producerDemo);
  14. if ($producerDemo) {
  15. $dateTime = strtotime("+7 day");
  16. $distribution = $distributionManager->createDistributionIfNotExist(date('Y-m-d', $dateTime));
  17. $distributionManager->activeDistribution($distribution);
  18. }
  19. }
  20. }
  21. ?>