| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace addons\QiJuhe\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230112012901CreateTableQijuheOrderRefund
- */
- class M230112012901CreateTableQijuheOrderRefund extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $table = 'qimall_addons_qijuhe_order_refund';
- $check_table_sql="select * from information_schema.TABLES where TABLE_NAME = '{$table}';";
- $res = $this->db->createCommand($check_table_sql)->execute();
- if(!empty($res)) return '';
- $sql = "CREATE TABLE `qimall_addons_qijuhe_order_refund` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned DEFAULT '0',
- `supply_id` int(10) DEFAULT NULL COMMENT '中台ID',
- `order_id` int(10) unsigned DEFAULT '0' COMMENT '订单ID',
- `num` int(10) unsigned DEFAULT '0' COMMENT '售后数量',
- `order_no` varchar(64) DEFAULT '' COMMENT '商城订单编号',
- `order_refund_id` int(10) unsigned DEFAULT '0' COMMENT '商城售后订单ID',
- `after_sales_id` int(10) DEFAULT NULL COMMENT '中台售后ID',
- `data` text COMMENT '售后数据',
- `status` tinyint(4) unsigned DEFAULT '0' COMMENT '是否推送售后',
- `refund_status` tinyint(4) unsigned DEFAULT '0',
- `shipping_address_id` int(10) unsigned DEFAULT '0' COMMENT '中台退货地址ID',
- `error_msg` varchar(255) DEFAULT '' COMMENT '错误信息',
- `return_data` text,
- `created_at` int(10) unsigned DEFAULT '0',
- `updated_at` int(10) unsigned DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `mall_id` (`mall_id`),
- KEY `order_id` (`order_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='七件事供应链售后表';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230112012901CreateTableQijuheOrderRefund cannot be reverted.\n";
- return false;
- }
- }
|