| 12345678910111213141516171819202122232425262728 |
- <?php
- namespace addons\Redpack\console\controllers;
- use addons\Redpack\common\logic\FrozenToActiveLogic;
- use yii\console\ExitCode;
- use yii\console\Controller;
- class RedpackController extends Controller
- {
- /**
- * 根据基础设置在规定时间将冻结红包激活到激活红包中
- */
- public function actionFrozenToActive() {
- try {
- $object = new FrozenToActiveLogic();
- $result = $object->FrozenToActive();
- if($result === true) {
- echo 'success';
- return ExitCode::OK;
- }
- } catch (\Exception $e) {
- echo '冻结红包转激活红包' . $e->getMessage();
- $this->stderr('Error: ' . ExitCode::getReason(ExitCode::UNSPECIFIED_ERROR));
- return ExitCode::UNSPECIFIED_ERROR;
- }
- }
- }
|