| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Handles the creation of table `{{%order_behavior_logs}}`.
- */
- class M240913015616CreateOrderBehaviorLogsTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_order_behavior_logs` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
- `operator_user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '操作人用户id',
- `operator_user_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '操作用户类型 1后台管理员操作 2用户操作 3门店独立后台 4爱优诺 5多商户 6系统自动操作',
- `behavior` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '操作行为 1创建订单 2取消订单 3订单支付 4提醒发货 5订单发货 6修改物流 7确认收货 8订单完成 9评价 10申请售后 11删除订单 12备注 13留言 14修改地址 15取消发货 16撤销售后',
- `desc` varchar(500) NOT NULL DEFAULT '',
- `extra_info` json DEFAULT NULL,
- `ip` int(10) unsigned NOT NULL DEFAULT '0',
- `status` tinyint(3) unsigned NOT NULL DEFAULT '1',
- `operation_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '实际操作时间',
- `order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单ID',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `operator_search_index` (`mall_id`,`operator_user_type`,`operator_user_id`,`behavior`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单行为日志表';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- }
|