提交 8bcfc0a9 编写于 作者: T Terry

购物车增加items_all_count 字段

上级 c2a2e1cd
<?php
use yii\db\Migration;
/**
* Class m190303_033900_fecshop_tables
*/
class m190303_033900_fecshop_tables extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$arr = [
"
ALTER TABLE `sales_flat_cart` CHANGE `items_count` `items_count` INT( 10 ) NULL DEFAULT '0' COMMENT '购物车中active状态产品的总个数,默认为0个'
",
"
ALTER TABLE `sales_flat_cart` ADD `items_all_count` INT( 10 ) NULL DEFAULT '0' COMMENT '购物车中全部产品的总个数,默认为0个' AFTER `items_count`
"
];
foreach ($arr as $sql) {
$this->execute($sql);
}
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
echo "m190303_033900_fecshop_tables cannot be reverted.\n";
return false;
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m190303_033900_fecshop_tables cannot be reverted.\n";
return false;
}
*/
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册