| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230901075829CreateHiGoReduceProfitTable
- */
- class M230901075829CreateHiGoReduceProfitTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->execute("CREATE TABLE `qimall_addons_store_merchant_reduce_profit` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `mall_id` INT(11) NOT NULL COMMENT '商城ID',
- `source` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '来源,插件名称' COLLATE 'utf8mb4_general_ci',
- `source_id` INT(11) NOT NULL DEFAULT '0' COMMENT '来源id',
- `user_id` INT(11) NOT NULL DEFAULT '0',
- `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',
- `rate` DECIMAL(5,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '让利比例',
- `audit_status` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '审核状态,1待审核, 50被拒绝,100审核通过',
- `audit_remark` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '审核备注' COLLATE 'utf8mb4_general_ci',
- `admins_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '审核人',
- `audit_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '审核时间',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `source_id` (`source_id`) USING BTREE,
- INDEX `user_id` (`user_id`) USING BTREE
- )
- COMMENT='商家让利'
- COLLATE='utf8mb4_general_ci'
- ENGINE=InnoDB;");
- $this->execute("INSERT INTO `qimall_addons_store_menu` (`title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES ('让利设置', '0', 8, 'store/client/merchant/profit-setting', '', 2, 0, 999, NULL, '', 1, 1679384514, 1679384514);");
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230901075829CreateHiGoReduceProfitTable cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230901075829CreateHiGoReduceProfitTable cannot be reverted.\n";
- return false;
- }
- */
- }
|