Browse Source

删除商品sku表无用的字段

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
f54bb14784
  1. 27
      vendor/antgoods/goods/src/migrations/m191202_082041_drop_columns_in_table_antgoods_goods_sku.php
  2. 12
      vendor/antgoods/goods/src/models/ars/GoodsSku.php

27
vendor/antgoods/goods/src/migrations/m191202_082041_drop_columns_in_table_antgoods_goods_sku.php

@ -0,0 +1,27 @@
<?php
use yii\db\Migration;
/**
* Class m191202_082041_drop_columns_in_table_antgoods_goods_sku
*/
class m191202_082041_drop_columns_in_table_antgoods_goods_sku extends Migration
{
public function up()
{
$this->dropColumn('antgoods_goods_sku', 'weight');
$this->dropColumn('antgoods_goods_sku', 'length');
$this->dropColumn('antgoods_goods_sku', 'width');
$this->dropColumn('antgoods_goods_sku', 'height');
$this->dropColumn('antgoods_goods_sku', 'diameter');
}
public function down()
{
$this->addColumn('antgoods_goods_sku', 'weight', $this->integer(8)->defaultValue(null)->comment('重量'));
$this->addColumn('antgoods_goods_sku', 'length', $this->integer(8)->defaultValue(null)->comment('长度'));
$this->addColumn('antgoods_goods_sku', 'width', $this->integer(8)->defaultValue(null)->comment('宽度'));
$this->addColumn('antgoods_goods_sku', 'height', $this->integer(8)->defaultValue(null)->comment('高度'));
$this->addColumn('antgoods_goods_sku', 'diameter', $this->integer(8)->defaultValue(null)->comment('直径'));
}
}

12
vendor/antgoods/goods/src/models/ars/GoodsSku.php

@ -13,11 +13,6 @@ use yii\behaviors\TimestampBehavior;
* @property string $goods_code 商品条码
* @property string $goods_sn 商品唯一货号
* @property string $goods_attr 属性匹配
* @property int $weight 重量
* @property int $length 长度
* @property int $width 宽度
* @property int $height 高度
* @property int $diameter 直径
* @property int $sold_count 已售数量
* @property int $stock 库存
* @property int $market_price 市场价
@ -53,7 +48,7 @@ class GoodsSku extends \yii\db\ActiveRecord
{
return [
[['goods_id', 'goods_sn'], 'required'],
[['goods_id', 'weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'stock', 'market_price', 'price', 'model_id', 'is_sale', 'sort_order', 'is_delete', 'is_manaul'], 'integer'],
[['goods_id', 'diameter', 'sold_count', 'stock', 'market_price', 'price', 'model_id', 'is_sale', 'sort_order', 'is_delete', 'is_manaul'], 'integer'],
[['goods_code'], 'string', 'max' => 50],
[['goods_sn', 'goods_attr'], 'string', 'max' => 60],
];
@ -70,11 +65,6 @@ class GoodsSku extends \yii\db\ActiveRecord
'goods_code' => '商品条码',
'goods_sn' => '商品唯一货号',
'goods_attr' => '属性匹配',
'weight' => '重量',
'length' => '长度',
'width' => '宽度',
'height' => '高度',
'diameter' => '直径',
'sold_count' => '已售数量',
'stock' => '库存',
'market_price' => '市场价',

Loading…
Cancel
Save