M241016092919AddTableQimallUserTeamMonthStatistics.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241016092919AddTableQimallUserTeamMonthStatistics
  6. */
  7. class M241016092919AddTableQimallUserTeamMonthStatistics extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_user_team_month_statistics` (
  15. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  16. `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城id',
  17. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
  18. `month` varchar(10) NOT NULL DEFAULT '' COMMENT '年月',
  19. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,-1删除,0禁用,1正常',
  20. `created_at` int(11) NOT NULL DEFAULT '0',
  21. `updated_at` int(11) NOT NULL DEFAULT '0',
  22. `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '支付完成业绩',
  23. `finish_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单完成业绩',
  24. PRIMARY KEY (`id`),
  25. KEY `m_u` (`mall_id`,`user_id`) USING BTREE
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员月份团队实付业绩表';";
  27. $this->execute($sql);
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function safeDown()
  33. {
  34. echo "M241016092919AddTableQimallUserTeamMonthStatistics cannot be reverted.\n";
  35. return false;
  36. }
  37. /*
  38. // Use up()/down() to run migration code without a transaction.
  39. public function up()
  40. {
  41. }
  42. public function down()
  43. {
  44. echo "M241016092919AddTableQimallUserTeamMonthStatistics cannot be reverted.\n";
  45. return false;
  46. }
  47. */
  48. }