RedpackController.php 833 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace addons\Redpack\console\controllers;
  3. use addons\Redpack\common\logic\FrozenToActiveLogic;
  4. use yii\console\ExitCode;
  5. use yii\console\Controller;
  6. class RedpackController extends Controller
  7. {
  8. /**
  9. * 根据基础设置在规定时间将冻结红包激活到激活红包中
  10. */
  11. public function actionFrozenToActive() {
  12. try {
  13. $object = new FrozenToActiveLogic();
  14. $result = $object->FrozenToActive();
  15. if($result === true) {
  16. echo 'success';
  17. return ExitCode::OK;
  18. }
  19. } catch (\Exception $e) {
  20. echo '冻结红包转激活红包' . $e->getMessage();
  21. $this->stderr('Error: ' . ExitCode::getReason(ExitCode::UNSPECIFIED_ERROR));
  22. return ExitCode::UNSPECIFIED_ERROR;
  23. }
  24. }
  25. }