| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace addons\Agent\console\migrations;
- use yii\db\Migration;
- /**
- * Handles the creation of table `{{%agent_supplier_commission}}`.
- */
- class M240906023848CreateAgentSupplierCommissionTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_addons_agent_supplier_commission` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0',
- `buy_user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '买家id',
- `buy_level` int(11) NOT NULL DEFAULT '0' COMMENT '买家身份',
- `seller_user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '卖家id',
- `seller_level` int(11) NOT NULL DEFAULT '0' COMMENT '卖家身份',
- `order_no` varchar(100) NOT NULL DEFAULT '' COMMENT '会员订单号',
- `supplier_order_no` varchar(100) NOT NULL DEFAULT '' COMMENT '供应商订单号',
- `goods_nums` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品数量',
- `stock_nums` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '库存加减',
- `payment_amount` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '货款金额',
- `profit` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '利润',
- `pay_time` int(11) NOT NULL DEFAULT '0' COMMENT '订单支付时间',
- `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间戳',
- `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间戳',
- `capital_type` varchar(50) NOT NULL DEFAULT '' COMMENT '奖励类型',
- `source_table` varchar(100) NOT NULL DEFAULT '',
- `source_table_id` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_order_no` (`order_no`) USING BTREE,
- KEY `idx_buy_user_id` (`buy_user_id`) USING BTREE,
- KEY `idx_seller_user_id` (`seller_user_id`) USING BTREE,
- KEY `pay_time` (`pay_time`,`order_no`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='供应商订单';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- }
|