M230901075829CreateHiGoReduceProfitTable.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230901075829CreateHiGoReduceProfitTable
  6. */
  7. class M230901075829CreateHiGoReduceProfitTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("CREATE TABLE `qimall_addons_store_merchant_reduce_profit` (
  15. `id` INT(11) NOT NULL AUTO_INCREMENT,
  16. `mall_id` INT(11) NOT NULL COMMENT '商城ID',
  17. `source` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '来源,插件名称' COLLATE 'utf8mb4_general_ci',
  18. `source_id` INT(11) NOT NULL DEFAULT '0' COMMENT '来源id',
  19. `user_id` INT(11) NOT NULL DEFAULT '0',
  20. `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  21. `created_at` INT(11) NOT NULL DEFAULT '0',
  22. `updated_at` INT(11) NOT NULL DEFAULT '0',
  23. `rate` DECIMAL(5,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '让利比例',
  24. `audit_status` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '审核状态,1待审核, 50被拒绝,100审核通过',
  25. `audit_remark` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '审核备注' COLLATE 'utf8mb4_general_ci',
  26. `admins_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '审核人',
  27. `audit_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '审核时间',
  28. PRIMARY KEY (`id`) USING BTREE,
  29. INDEX `source_id` (`source_id`) USING BTREE,
  30. INDEX `user_id` (`user_id`) USING BTREE
  31. )
  32. COMMENT='商家让利'
  33. COLLATE='utf8mb4_general_ci'
  34. ENGINE=InnoDB;");
  35. $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);");
  36. }
  37. /**
  38. * {@inheritdoc}
  39. */
  40. public function safeDown()
  41. {
  42. echo "M230901075829CreateHiGoReduceProfitTable cannot be reverted.\n";
  43. return false;
  44. }
  45. /*
  46. // Use up()/down() to run migration code without a transaction.
  47. public function up()
  48. {
  49. }
  50. public function down()
  51. {
  52. echo "M230901075829CreateHiGoReduceProfitTable cannot be reverted.\n";
  53. return false;
  54. }
  55. */
  56. }