M240419035630CreateUserTeamPerformanceStatistics.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240419035630CreateUserTeamPerformanceStatistics
  6. */
  7. class M240419035630CreateUserTeamPerformanceStatistics extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_user_team_performance_statistics` (
  15. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  16. `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城ID',
  17. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  18. `pay_team_performance` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '总团队利润业绩[订单支付]',
  19. `accomplish_team_performance` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '总团队利润业绩[订单完成]',
  20. `pay_big_market_performance` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '大市场利润业绩[订单支付]',
  21. `accomplish_big_market_performance` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '大市场利润业绩[订单完成]',
  22. `pay_user_performance` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '用户利润业绩[订单支付]',
  23. `accomplish_user_performance` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '用户利润业绩[订单完成]',
  24. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1删除; 0禁用; 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 `idx_mall_user_id` (`mall_id`,`user_id`) USING BTREE
  29. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
  30. $this->execute($sql);
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function safeDown()
  36. {
  37. echo "M240419035630CreateUserTeamPerformanceStatistics cannot be reverted.\n";
  38. return false;
  39. }
  40. /*
  41. // Use up()/down() to run migration code without a transaction.
  42. public function up()
  43. {
  44. }
  45. public function down()
  46. {
  47. echo "M240419035630CreateUserTeamPerformanceStatistics cannot be reverted.\n";
  48. return false;
  49. }
  50. */
  51. }