Browse Source

修改运费模板逻辑,删除其中无用的字段,增加创建运费区域价格数据表

antshop
linyaostalker 5 years ago
parent
commit
9c55344af3
  1. 32
      backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php
  2. 36
      backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php

32
backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php

@ -0,0 +1,32 @@
<?php
use yii\db\Migration;
/**
* Class m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template
*/
class m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template extends Migration
{
public function up()
{
$this->dropColumn('ats_express_template', 'province');
$this->dropColumn('ats_express_template', 'city');
$this->dropColumn('ats_express_template', 'area');
$this->dropColumn('ats_express_template', 'extra_price');
$this->dropColumn('ats_express_template', 'basic_price');
$this->dropColumn('ats_express_template', 'basic_count');
$this->dropColumn('ats_express_template', 'extra_count');
}
public function down()
{
$this->addColumn('ats_express_template', 'province', $this->text()->comment('省份'));
$this->addColumn('ats_express_template', 'city', $this->text()->comment('城市'));
$this->addColumn('ats_express_template', 'area', $this->text()->comment('区域'));
$this->addColumn('ats_express_template', 'extra_price', $this->integer(20)->defaultValue(null)->comment('续重运费'));
$this->addColumn('ats_express_template', 'basic_price', $this->integer(20)->defaultValue(null)->comment('基本运费'));
$this->addColumn('ats_express_template', 'basic_count', $this->integer(20)->defaultValue(null)->comment('基本数量'));
$this->addColumn('ats_express_template', 'extra_count', $this->integer(20)->defaultValue(null)->comment('续重数量'));
return true;
}
}

36
backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php

@ -0,0 +1,36 @@
<?php
use yii\db\Migration;
/**
* Class m191205_092942_create_table_ats_express_area
*/
class m191205_092942_create_table_ats_express_area extends Migration
{
public function up()
{
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="快递区域价格表"';
$this->createTable('ats_express_area', [
'id' => $this->primaryKey(),
'province' => $this->text()->comment('省份'),
'city' => $this->text()->comment('城市'),
'area' => $this->text()->comment('区域'),
'express_template' => $this->integer(11)->defaultValue(null)->comment('运费模板id'),
'extra_price' => $this->integer(20)->defaultValue(null)->comment('续重运费'),
'basic_price' => $this->integer(20)->defaultValue(null)->comment('基本运费'),
'basic_count' => $this->integer(20)->defaultValue(null)->comment('基本数量'),
'extra_count' => $this->integer(20)->defaultValue(null)->comment('续重数量'),
'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
],$tableOptions);
}
/**
* {@inheritdoc}
*/
public function down()
{
$this->dropTable('ats_express_area');
return true;
}
}
Loading…
Cancel
Save