| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace console\controllers;
- use yii\console\ExitCode;
- use yii\console\Controller;
- use addons\SignIn\common\login\SignInReward;
- class SignController extends Controller
- {
- /**
- * 清除累计签到天数
- *
- * @author hpei
- * 0 0 0 * * *
- */
- public function actionCleanTotalSignIn() {
- try {
- $object = new SignInReward();
- $result = $object->cleanTotalSignIn();
- 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;
- }
- }
- }
|