Browse Source

处理商品分类icon_type字段,并在表单中删除

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
8ebddf2c08
  1. 22
      vendor/antgoods/goods/src/migrations/m191125_012449_update_column_icon_type_in_antgoods_category.php
  2. 2
      vendor/antgoods/goods/src/views/category/_form.php

22
vendor/antgoods/goods/src/migrations/m191125_012449_update_column_icon_type_in_antgoods_category.php

@ -0,0 +1,22 @@
<?php
use yii\db\Migration;
/**
* Class m191125_012449_update_column_icon_type_in_antgoods_category
*/
class m191125_012449_update_column_icon_type_in_antgoods_category extends Migration
{
public function up()
{
$this->dropColumn('antgoods_category', 'icon_type');
$this->addColumn('antgoods_category', 'icon_type', $this->tinyInteger(1)->defaultValue(1)->comment('图标类型'));
}
public function down()
{
$this->dropColumn('antgoods_category', 'icon_type');
$this->addColumn('antgoods_category', 'icon_type', $this->tinyInteger(1)->defaultValue(null)->comment('图标类型'));
return true;
}
}

2
vendor/antgoods/goods/src/views/category/_form.php

@ -19,8 +19,6 @@ use blobt\widgets\Icheck;
<?= $form->field($model, 'sort_order')->textInput() ?>
<?= $form->field($model, 'icon_type')->textInput() ?>
<?= $form->field($model, 'icon')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'is_show')->widget(Icheck::className(), ["items" => $model::$isShow, 'type' => "radio"]) ?>

Loading…
Cancel
Save