@ -45,7 +45,7 @@ class ExpressTemplate extends \yii\db\ActiveRecord
public function rules()
{
return [
[['name'], 'required'],
[['name', 'calculation'], 'required'],
[['province', 'city', 'area'], 'string'],
[['calculation', 'basic_price', 'basic_amount', 'extra_price', 'extra_amount'], 'integer'],
[['name'], 'string', 'max' => 255],
@ -0,0 +1,22 @@
<?php
use yii\db\Migration;
/**
* Class m191204_004849_update_column_calculation_in_table_ats_express_template
*/
class m191204_004849_update_column_calculation_in_table_ats_express_template extends Migration
public function up()
$this->dropColumn('ats_express_template', 'calculation');
$this->addColumn('ats_express_template', 'calculation', $this->tinyInteger(2)->defaultValue(0)->notNull()->comment('计算方式'));
}
public function down()
$this->addColumn('ats_express_template', 'calculation', $this->tinyInteger(2)->defaultValue(0)->comment('计算方式'));
return true;