linyaostalker
5 years ago
2 changed files with 109 additions and 25 deletions
-
68backend/modules/shop/migrations/m191209_080245_update_table_after_sale.php
-
66backend/modules/shop/models/ars/AfterSale.php
@ -0,0 +1,68 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191209_080245_update_table_after_sale |
|||
*/ |
|||
class m191209_080245_update_table_after_sale extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$this->dropTable('ats_after_sale'); |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="售后表"'; |
|||
$this->createTable('ats_after_sale', [ |
|||
'id' => $this->primaryKey(), |
|||
'wx_refund_id'=>$this->string(64)->defaultValue('')->notNull()->comment('微信退款单号'), |
|||
'after_sale_sn'=>$this->string(64)->defaultValue('')->notNull()->comment('售后单号'), |
|||
'user_id'=>$this->integer(11)->defaultValue('0')->notNull()->comment('用户id'), |
|||
'order_goods_id'=>$this->integer(11)->defaultValue('0')->notNull()->comment('订单商品id'), |
|||
'amount'=>$this->integer(20)->defaultValue("0")->notNull()->comment('退货时实际退的金额'), |
|||
'count'=>$this->integer(11)->defaultValue("0")->notNull()->comment('退换货的商品数量'), |
|||
'apply_at'=>$this->integer(11)->defaultValue(null)->comment('申请时间'), |
|||
'dealt_at'=>$this->integer(11)->defaultValue(null)->comment('处理时间'), |
|||
'finish_at'=>$this->integer(11)->defaultValue(null)->comment('完成时间'), |
|||
'operator_id'=>$this->integer(11)->defaultValue("0")->notNull()->comment('操作者'), |
|||
'refund_type'=>$this->tinyInteger(1)->defaultValue("1")->comment('退款类型:1:全额退款;2:部分退款'), |
|||
'description'=>$this->text()->comment('描述'), |
|||
'image' => $this->text()->comment('图片'), |
|||
'status' => $this->tinyInteger(2)->defaultValue('0')->notNull()->comment('处理状态:0:未处理;1:已同意,待买家确认;2:用户已确认;3:已拒绝;4:退款成功;5:已取消;'), |
|||
'reason'=>$this->smallInteger(2)->defaultValue("0")->comment('退换货理由'), |
|||
'remarks'=>$this->text()->comment('店家备注'), |
|||
'take_shipping_sn'=>$this->string(50)->defaultValue(null)->comment('用户发货物流单号'), |
|||
'refund_mode' => $this->tinyInteger(2)->defaultValue('1')->notNull()->comment('退款方式:1:仅退款;2:退货退款;') |
|||
],$tableOptions); |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function down() |
|||
{ |
|||
$this->dropTable('ats_after_sale'); |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="售后表"'; |
|||
$this->createTable('ats_after_sale', [ |
|||
'id' => $this->primaryKey(), |
|||
'operator_id'=>$this->integer(11)->notNull()->comment('操作者'), |
|||
'user_id'=>$this->integer(11)->notNull()->comment('用户id'), |
|||
'wx_refund_id'=>$this->string(64)->defaultValue(null)->comment('微信退款单号'), |
|||
'after_sale_sn'=>$this->string(64)->defaultValue(null)->comment('售后单号'), |
|||
'order_goods_id'=>$this->integer(11)->defaultValue(null)->comment('订单商品id'), |
|||
'count'=>$this->integer(11)->defaultValue(null)->comment('退换货的商品数量'), |
|||
'amount'=>$this->integer(20)->notNull()->comment('退货时实际退的金额'), |
|||
'type'=>$this->tinyInteger(1)->defaultValue(0)->comment('类型'), |
|||
'reason'=>$this->smallInteger(2)->defaultValue(0)->comment('退换货理由'), |
|||
'description'=>$this->text()->comment('描述'), |
|||
'take_shipping_sn'=>$this->string(50)->defaultValue(null)->comment('用户发货物流单号'), |
|||
'send_shipping_sn'=>$this->string(50)->defaultValue(null)->comment('换货商家发货的物流单号'), |
|||
'remarks'=>$this->text()->comment('店家备注'), |
|||
'applyed_at'=>$this->integer(11)->defaultValue(null)->comment('申请时间'), |
|||
'dealed_at'=>$this->integer(11)->defaultValue(null)->comment('处理时间'), |
|||
'finished_at'=>$this->integer(11)->defaultValue(null)->comment('完成时间'), |
|||
],$tableOptions); |
|||
return true; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue