root
5 years ago
9 changed files with 104 additions and 15 deletions
-
8backend/modules/goods/controllers/GoodsController.php
-
8backend/modules/goods/logic/goods/GoodsManager.php
-
23backend/modules/goods/migrations/m191209_091129_update_columns_in_table_atg_goods.php
-
20backend/modules/goods/migrations/m191209_091524_add_column_weight_in_table_atg_goods_sku.php
-
17backend/modules/goods/migrations/sql/update_goods.sql
-
5backend/modules/goods/models/ars/GoodsSku.php
-
10backend/modules/goods/views/goods/express.php
-
20backend/modules/goods/views/goods/goods.php
-
8backend/modules/shop/controllers/ExpressTemplateController.php
@ -0,0 +1,23 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use yii\db\Migration; |
||||
|
|
||||
|
/** |
||||
|
* Class m191209_091129_update_columns_in_table_atg_goods |
||||
|
*/ |
||||
|
class m191209_091129_update_columns_in_table_atg_goods extends Migration |
||||
|
{ |
||||
|
public function up() |
||||
|
{ |
||||
|
$sql = file_get_contents(__DIR__."/sql/update_goods.sql"); |
||||
|
$this->execute($sql); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* {@inheritdoc} |
||||
|
*/ |
||||
|
public function down() |
||||
|
{ |
||||
|
return true; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use yii\db\Migration; |
||||
|
|
||||
|
/** |
||||
|
* Class m191209_091524_add_column_weight_in_table_atg_goods_sku |
||||
|
*/ |
||||
|
class m191209_091524_add_column_weight_in_table_atg_goods_sku extends Migration |
||||
|
{ |
||||
|
public function up() |
||||
|
{ |
||||
|
$this->addColumn('atg_goods_sku', 'weight', $this->integer(8)->defaultValue("0")->unsigned()->comment('重量')); |
||||
|
} |
||||
|
|
||||
|
public function down() |
||||
|
{ |
||||
|
$this->dropColumn('atg_goods_sku', 'weight'); |
||||
|
return true; |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
ALTER TABLE `atg_goods` DROP `weight`; |
||||
|
ALTER TABLE `atg_goods` DROP `length`; |
||||
|
ALTER TABLE `atg_goods` DROP `width`; |
||||
|
ALTER TABLE `atg_goods` DROP `height`; |
||||
|
ALTER TABLE `atg_goods` DROP `diameter`; |
||||
|
ALTER TABLE `atg_goods` DROP `sold_count`; |
||||
|
ALTER TABLE `atg_goods` DROP `market_price`; |
||||
|
ALTER TABLE `atg_goods` DROP `price`; |
||||
|
|
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `weight` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '重量'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `length` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '长度'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `width` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '宽度'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `height` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '高度'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `diameter` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '直径'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `sold_count` int(10) UNSIGNED DEFAULT NULL COMMENT '已售数量'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `market_price` int(20) UNSIGNED DEFAULT NULL COMMENT '市场价'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `price` int(20) UNSIGNED DEFAULT NULL COMMENT '销售价'; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue