Skip to content

Commit

Permalink
add version_code field
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksleo committed Jul 25, 2017
1 parent ff49476 commit 4426bf7
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/messages/zh-CN/romrelease.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'Yes' => '',
'No' => '',
'version' => '版本号',
'version code' => '版本代号',
'is forced' => '强制更新',
'url' => '下载地址',
'status' => '状态',
Expand Down
1 change: 1 addition & 0 deletions src/messages/zh-TW/romrelease.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'Yes' => '',
'No' => '',
'version' => '版本號',
'version code' => '版本代號',
'is forced' => '強制更新',
'url' => '下載地址',
'status' => '狀態',
Expand Down
1 change: 1 addition & 0 deletions src/migrations/m170724_064147_create_rom_release_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function up()
$this->createTable('{{%rom_release}}', [
'id' => $this->primaryKey(),
'version' => $this->string()->notNull()->comment('版本号'),
'version_code' => $this->string()->null()->comment('版本代号'),
'is_forced' => $this->boolean()->notNull()->defaultValue(1)->comment('强制更新'),
'url' => $this->string()->notNull()->comment('下载地址'),
'md5' => $this->string()->notNull()->comment('MD5'),
Expand Down
3 changes: 3 additions & 0 deletions src/models/RomRelease.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* @property integer $id
* @property integer $version
* @property integer $version_code
* @property integer $is_forced
* @property string $url
* @property string $md5
Expand Down Expand Up @@ -47,6 +48,7 @@ public function rules()
[['is_forced', 'status'], 'default', 'value' => 1],
[['description', 'version'], 'string', 'max' => 255],
['md5', 'string', 'max' => 255, 'on' => ['save']],
['version_code', 'safe'],
[['url'], 'file',
//'extensions' => 'apk',
'skipOnEmpty' => true,
Expand All @@ -66,6 +68,7 @@ public function attributeLabels()
return [
'id' => Module::t('romrelease', 'ID'),
'version' => Module::t('romrelease', 'version'),
'version_code' => Module::t('romrelease', 'version code'),
'is_forced' => Module::t('romrelease', 'is forced'),
'url' => Module::t('romrelease', 'url'),
'md5' => Module::t('romrelease', 'MD5'),
Expand Down
1 change: 1 addition & 0 deletions src/views/default/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'options' => ['enctype' => 'multipart/form-data']
]); ?>
<?= $form->field($model, 'version')->textInput() ?>
<?= $form->field($model, 'version_code')->textInput() ?>
<?= $form->field($model, 'is_forced')->inline(true)->textInput()->radioList([
'0' => Yii::t('yii', 'No'),
'1' => Yii::t('yii', 'Yes'),
Expand Down
1 change: 1 addition & 0 deletions src/views/default/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'version',
'version_code',
[
'attribute' => 'status',
'value' => function ($model) {
Expand Down
1 change: 1 addition & 0 deletions src/views/default/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'model' => $model,
'attributes' => [
'version',
'version_code',
[
'attribute' => 'is_forced',
'value' => $model->is_forced == 1 ? '' : '',
Expand Down

0 comments on commit 4426bf7

Please sign in to comment.