db->createCommand($sql)->execute(); if(!empty($res)) return ''; $this->execute("CREATE TABLE `qimall_order_unread_msg` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商场ID', `order_pay_num` int(11) DEFAULT NULL COMMENT '待付款数量', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `order_received_num` int(11) DEFAULT NULL COMMENT '待收货数量', `order_goods_num` int(11) DEFAULT NULL COMMENT '待发货数量', `order_evaluate_num` int(11) DEFAULT NULL COMMENT '待评价数量', `order_return_num` int(11) DEFAULT NULL COMMENT '退货数量', `user_id` int(11) DEFAULT NULL COMMENT '会员ID', `is_statistics` int(11) DEFAULT '0' COMMENT '是否已经执行过统计,因为这功能是后面上的,需要执行一次统计数据才会正确', PRIMARY KEY (`id`) USING BTREE, KEY `mall_id` (`mall_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='会员订单未读消息统计'"); } public function safeDown() { $this->dropTable('qimall_order_unread_msg'); } }