|
123456789101112131415161718192021222324252627 |
- <?php
-
- namespace console\commands;
-
- use common\logic\Distribution\Distribution\Module\DistributionModule;
- use common\logic\Producer\Producer\Module\ProducerModule;
- use yii\console\Controller;
-
- class DemoAccountController extends Controller
- {
- public function actionIndex()
- {
- $producerModule = ProducerModule::getInstance();
- $distributionModule =DistributionModule::getInstance();
-
- $producerDemo = $producerModule->findOneProducerDemoAccount();
- \Yii::$app->logic->setProducerContext($producerDemo);
-
- if ($producerDemo) {
- $dateTime = strtotime("+7 day");
- $distribution = $distributionModule->createDistributionIfNotExist(date('Y-m-d', $dateTime));
- $distributionModule->activeDistribution($distribution);
- }
- }
- }
-
- ?>
|