@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | const AFTER_REGISTER = 'afterRegister'; |
| 59 | 59 | |
| 60 | 60 | //场景定义 |
| 61 | - const SCENARIO_CREATE = 'create';//后台或控制台创建用户 |
|
| 62 | - const SCENARIO_UPDATE = 'update';//后台或控制台修改用户 |
|
| 63 | - const SCENARIO_REGISTER = 'basic_create';//邮箱注册 |
|
| 64 | - const SCENARIO_EMAIL_REGISTER = 'email_create';//邮箱注册 |
|
| 65 | - const SCENARIO_MOBILE_REGISTER = 'mobile_create';//手机号注册 |
|
| 66 | - const SCENARIO_SETTINGS = 'settings';//更新 |
|
| 67 | - const SCENARIO_CONNECT = 'connect';//账户链接或自动注册新用户 |
|
| 61 | + const SCENARIO_CREATE = 'create'; //后台或控制台创建用户 |
|
| 62 | + const SCENARIO_UPDATE = 'update'; //后台或控制台修改用户 |
|
| 63 | + const SCENARIO_REGISTER = 'basic_create'; //邮箱注册 |
|
| 64 | + const SCENARIO_EMAIL_REGISTER = 'email_create'; //邮箱注册 |
|
| 65 | + const SCENARIO_MOBILE_REGISTER = 'mobile_create'; //手机号注册 |
|
| 66 | + const SCENARIO_SETTINGS = 'settings'; //更新 |
|
| 67 | + const SCENARIO_CONNECT = 'connect'; //账户链接或自动注册新用户 |
|
| 68 | 68 | const SCENARIO_PASSWORD = 'password'; |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | static::SCENARIO_EMAIL_REGISTER => ['nickname', 'email', 'password'], |
| 106 | 106 | static::SCENARIO_MOBILE_REGISTER => ['mobile', 'password'], |
| 107 | 107 | static::SCENARIO_SETTINGS => ['username', 'email', 'password'], |
| 108 | - static::SCENARIO_CONNECT => ['nickname', 'email', 'password'],//链接账户密码可以为空邮箱可以为空 |
|
| 109 | - static::SCENARIO_PASSWORD => ['password'],//只修改密码 |
|
| 108 | + static::SCENARIO_CONNECT => ['nickname', 'email', 'password'], //链接账户密码可以为空邮箱可以为空 |
|
| 109 | + static::SCENARIO_PASSWORD => ['password'], //只修改密码 |
|
| 110 | 110 | ]); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | if ($this->balance < 0) {//计算后如果余额小于0,那么结果不合法。 |
| 319 | 319 | return false; |
| 320 | 320 | } |
| 321 | - $transaction = static::getDb()->beginTransaction();//开始事务 |
|
| 321 | + $transaction = static::getDb()->beginTransaction(); //开始事务 |
|
| 322 | 322 | try { |
| 323 | 323 | if ($this->save()) { |
| 324 | 324 | $transaction->commit(); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | if ($this->transfer_balance < 0) {//计算后如果余额小于0,那么结果不合法。 |
| 361 | 361 | return false; |
| 362 | 362 | } |
| 363 | - $transaction = static::getDb()->beginTransaction();//开始事务 |
|
| 363 | + $transaction = static::getDb()->beginTransaction(); //开始事务 |
|
| 364 | 364 | try { |
| 365 | 365 | if ($this->save()) { |
| 366 | 366 | $transaction->commit(); |
@@ -77,14 +77,14 @@ |
||
| 77 | 77 | case self::TYPE_CONFIRMATION: |
| 78 | 78 | case self::TYPE_CONFIRM_NEW_EMAIL: |
| 79 | 79 | case self::TYPE_CONFIRM_OLD_EMAIL: |
| 80 | - $expirationTime =Yii::$app->settings->get('confirmWithin','user'); |
|
| 80 | + $expirationTime = Yii::$app->settings->get('confirmWithin', 'user'); |
|
| 81 | 81 | break; |
| 82 | 82 | case self::TYPE_CONFIRM_NEW_MOBILE: |
| 83 | 83 | case self::TYPE_CONFIRM_OLD_MOBILE: |
| 84 | - $expirationTime = Yii::$app->settings->get('confirmWithin','user'); |
|
| 84 | + $expirationTime = Yii::$app->settings->get('confirmWithin', 'user'); |
|
| 85 | 85 | break; |
| 86 | 86 | case self::TYPE_RECOVERY: |
| 87 | - $expirationTime = Yii::$app->settings->get('recoverWithin','user'); |
|
| 87 | + $expirationTime = Yii::$app->settings->get('recoverWithin', 'user'); |
|
| 88 | 88 | break; |
| 89 | 89 | default: |
| 90 | 90 | throw new \RuntimeException(); |
@@ -149,13 +149,13 @@ |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | - * Batch Delete existing Volume model. |
|
| 153 | - * If deletion is successful, the browser will be redirected to the 'index' page. |
|
| 154 | - * @return mixed |
|
| 155 | - * @throws NotFoundHttpException |
|
| 156 | - * @throws \Throwable |
|
| 157 | - * @throws \yii\db\StaleObjectException |
|
| 158 | - */ |
|
| 152 | + * Batch Delete existing Volume model. |
|
| 153 | + * If deletion is successful, the browser will be redirected to the 'index' page. |
|
| 154 | + * @return mixed |
|
| 155 | + * @throws NotFoundHttpException |
|
| 156 | + * @throws \Throwable |
|
| 157 | + * @throws \yii\db\StaleObjectException |
|
| 158 | + */ |
|
| 159 | 159 | public function actionBatchDelete() |
| 160 | 160 | { |
| 161 | 161 | if (($ids = Yii::$app->request->post('ids', null)) != null) { |
@@ -182,7 +182,7 @@ |
||
| 182 | 182 | if (($model = Volume::findOne($id)) !== null) { |
| 183 | 183 | return $model; |
| 184 | 184 | } else { |
| 185 | - throw new NotFoundHttpException (Yii::t('yii', 'The requested page does not exist.')); |
|
| 185 | + throw new NotFoundHttpException(Yii::t('yii', 'The requested page does not exist.')); |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | 'pub:boolean', |
| 70 | 70 | [ |
| 71 | 71 | 'attribute' => 'status', |
| 72 | - 'value' => function ($model) { |
|
| 72 | + 'value' => function($model) { |
|
| 73 | 73 | return $model->status == \yuncms\models\Volume::STATUS_ACTIVE ? Yii::t('yuncms', 'Active') : Yii::t('yuncms', 'Disable'); |
| 74 | 74 | }, |
| 75 | 75 | 'label' => Yii::t('yuncms', 'Status'), |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | </div> |
| 39 | 39 | </div> |
| 40 | 40 | |
| 41 | - <?php $form = ActiveForm::begin(['layout' => 'horizontal', 'enableAjaxValidation' => true, 'enableClientValidation' => false,]); ?> |
|
| 41 | + <?php $form = ActiveForm::begin(['layout' => 'horizontal', 'enableAjaxValidation' => true, 'enableClientValidation' => false, ]); ?> |
|
| 42 | 42 | <?= $form->field($model, 'identity')->hiddenInput()->label(false) ?> |
| 43 | 43 | <?= $form->field($model, 'name')->hiddenInput()->label(false) ?> |
| 44 | 44 | <?= $form->field($model, 'class')->hiddenInput()->label(false) ?> |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | /* @var yuncms\models\Volume $model */ |
| 9 | 9 | /* @var ActiveForm $form */ |
| 10 | 10 | ?> |
| 11 | -<?php $form = ActiveForm::begin(['layout' => 'horizontal', 'enableAjaxValidation' => true, 'enableClientValidation' => false,]); ?> |
|
| 11 | +<?php $form = ActiveForm::begin(['layout' => 'horizontal', 'enableAjaxValidation' => true, 'enableClientValidation' => false, ]); ?> |
|
| 12 | 12 | |
| 13 | 13 | <?= $form->field($model, 'identity')->textInput(['maxlength' => true]) ?> |
| 14 | 14 | <div class="hr-line-dashed"></div> |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | 'pub:boolean', |
| 73 | 73 | [ |
| 74 | 74 | 'attribute' => 'status', |
| 75 | - 'value' => function ($model) { |
|
| 75 | + 'value' => function($model) { |
|
| 76 | 76 | return $model->status == Volume::STATUS_ACTIVE ? Yii::t('yuncms', 'Active') : Yii::t('yuncms', 'Disable'); |
| 77 | 77 | }, |
| 78 | 78 | 'label' => Yii::t('yuncms', 'Status'), |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | [ |
| 99 | 99 | 'class' => 'yuncms\grid\ActionColumn', |
| 100 | 100 | 'template' => '{configuration} {view} {update} {delete}', |
| 101 | - 'buttons' => ['configuration' => function ($url, $model, $key) { |
|
| 101 | + 'buttons' => ['configuration' => function($url, $model, $key) { |
|
| 102 | 102 | return Html::a('<span class="glyphicon glyphicon-cog"></span>', |
| 103 | 103 | Url::toRoute(['configuration', 'id' => $model->id]), [ |
| 104 | 104 | 'title' => Yii::t('yuncms', 'Configuration'), |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | } elseif (!is_writable($directory)) { |
| 85 | 85 | throw new FileException(sprintf('Unable to write in the "%s" directory', $directory)); |
| 86 | 86 | } |
| 87 | - $target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); |
|
| 87 | + $target = rtrim($directory, '/\\') . DIRECTORY_SEPARATOR . (null === $name ? $this->getBasename() : $this->getName($name)); |
|
| 88 | 88 | return new self($target, false); |
| 89 | 89 | } |
| 90 | 90 | |