M230918020037BalanceRecharge.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230918020037BalanceRecharge
  6. */
  7. class M230918020037BalanceRecharge extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "INSERT INTO `qimall_menu` (`title`, `app_id`, `cate_id`, `addons_name`, `is_addon`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES ('充值审核', 'backend', '2', '', '0', '35', 'mall/finance/recharge-audit', '', '2', '1', '999', NULL, 'tr_0 tr_35', '1', '1694766835', '1694766835');";
  15. $this->execute($sql);
  16. $sql = "CREATE TABLE `qimall_balance_recharge_log` (
  17. `id` int(11) NOT NULL AUTO_INCREMENT,
  18. `mall_id` int(11) NOT NULL,
  19. `user_id` int(11) NOT NULL,
  20. `num` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '充值金额',
  21. `withdraw_status` int(11) NOT NULL DEFAULT '0' COMMENT '申请状态 0--申请 1--同意 2--驳回',
  22. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '备注',
  23. `payment_evidence` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '支付凭证',
  24. `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态[0禁用 1启用 -1删除]',
  25. `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间戳',
  26. `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间戳',
  27. PRIMARY KEY (`id`),
  28. KEY `index_mall_id` (`mall_id`) USING BTREE,
  29. KEY `index_user_id` (`user_id`) USING BTREE
  30. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;";
  31. $this->execute($sql);
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function safeDown()
  37. {
  38. echo "M230918020037BalanceRecharge cannot be reverted.\n";
  39. return false;
  40. }
  41. /*
  42. // Use up()/down() to run migration code without a transaction.
  43. public function up()
  44. {
  45. }
  46. public function down()
  47. {
  48. echo "M230918020037BalanceRecharge cannot be reverted.\n";
  49. return false;
  50. }
  51. */
  52. }