| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace addons\CloudStock\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230904102932CloudStockFillStatisticsUpdate
- */
- class M230904102932CloudStockFillStatisticsUpdate extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "ALTER TABLE `qimall_addons_cloud_stock_fill_statistics` MODIFY COLUMN `self_num` decimal(12,2) NOT NULL COMMENT '自身补货数量',MODIFY COLUMN `direct_num` decimal(12,2) NOT NULL COMMENT '直推们的数量,等级一致',MODIFY COLUMN `indirect_num` decimal(12,2) NOT NULL COMMENT '间推们数量,等级一致';";
- $this->execute($sql);
- $sql = "ALTER TABLE `qimall_addons_cloud_stock_fill_statistics` ADD COLUMN `award_proportion_calculate_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '计算方式'";
- $this->execute($sql);
- $sql = "CREATE TABLE `qimall_addons_cloud_stock_increase_by_platform_log` (
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `mall_id` int(11) NOT NULL COMMENT '商城id',
- `user_id` int(11) NOT NULL COMMENT '增加库存代理商用户id',
- `goods_id` int(11) NOT NULL COMMENT '商品id',
- `changes_type` int(11) NOT NULL COMMENT '库存变动类型;100向上级补货;101上级给自己配货;102退货退库存;103系统添加;104平台补货赠送;105购买礼包赠送;',
- `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单id',
- `order_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'order类型,1:会员购买订单,2:补货订单;',
- `num` int(11) NOT NULL COMMENT '增加数量',
- `fill_unit_price` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '补货单价',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='补货记录表';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230904102932CloudStockFillStatisticsUpdate cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230904102932CloudStockFillStatisticsUpdate cannot be reverted.\n";
- return false;
- }
- */
- }
|