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 line
806B

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