M230322023449RealAuthTaodonglai.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace addons\RealAuth\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230322023449RealAuthTaodonglai
  6. */
  7. class M230322023449RealAuthTaodonglai extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_addons_real_auth_user` ADD COLUMN `auth_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '实名认证类型:0未知,1 个人 2 企业';";
  15. $sql .= "ALTER TABLE `qimall_addons_real_auth_user` ADD COLUMN `business_code` varchar(100) NOT NULL DEFAULT '' COMMENT '营业执照号码';";
  16. $sql .= "CREATE TABLE `qimall_addons_real_auth_detail` (
  17. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  18. `mall_id` int(11) unsigned NOT NULL DEFAULT '0',
  19. `auth_id` int(11) NOT NULL DEFAULT '0' COMMENT '实名认证id',
  20. `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  21. `auth_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '实名认证类型:0未知,1 个人 2 企业',
  22. `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间戳',
  23. `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间戳',
  24. `detail` json NOT NULL COMMENT '实名认证资料,json格式',
  25. `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  26. `check_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '审核时间戳',
  27. `check_status` tinyint(4) DEFAULT '0' COMMENT '审核状态[0:未审核;1:通过;2拒绝]',
  28. `remark` varchar(500) NOT NULL DEFAULT '' COMMENT '备注',
  29. PRIMARY KEY (`id`) USING BTREE
  30. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;";
  31. $this->execute($sql);
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function safeDown()
  37. {
  38. echo "M230322023449RealAuthTaodonglai 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 "M230322023449RealAuthTaodonglai cannot be reverted.\n";
  49. return false;
  50. }
  51. */
  52. }