| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace addons\Mch\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230322022448AddonsMchTaodonglai
- */
- class M230322022448AddonsMchTaodonglai extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_mch_settlement_log` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单id',
- `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
- `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- `order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '订单编号',
- `is_settlement` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已结算',
- `settlement_at` int(11) NOT NULL DEFAULT '0' COMMENT '结算时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='多商户结算记录表';";
- $sql .= "INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('多商户订单结算', 'mch/index/settlement-log', '1', '0 */30 * * * *', '0', '1', '1679104279', '1679104279');";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230322022448AddonsMchTaodonglai cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230322022448AddonsMchTaodonglai cannot be reverted.\n";
- return false;
- }
- */
- }
|