M240621035039CreateAddonsAgentDelayLog.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240621035039CreateAddonsAgentDelayLog
  6. */
  7. class M240621035039CreateAddonsAgentDelayLog extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_addons_agent_delay_log` (
  16. `id` int(11) NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(11) NOT NULL COMMENT '商城ID',
  18. `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
  19. `compute_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '结算方式, 0订单完成后,1订单支付后',
  20. `wallet_type` varchar(64) NOT NULL COMMENT '资产类型',
  21. `wallet_num` decimal(12,2) NOT NULL DEFAULT 0 COMMENT '结算资产数量',
  22. `day_num` int(11) NOT NULL DEFAULT 0 COMMENT '延时天数',
  23. `wallet_desc` varchar(255) COMMENT '资产变动说明',
  24. `order_no` varchar(100) COMMENT '订单编号',
  25. `capital_type` varchar(64) NOT NULL COMMENT '资金奖励类型',
  26. `contributor_name` varchar(255) COMMENT '资产类型',
  27. `contributor_money` decimal(12,2) COMMENT '分佣金额/手续费',
  28. `contributor_id` int(11) NOT NULL COMMENT '贡献者id',
  29. `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态,0未结算,1已结算',
  30. `agented_at` int(11) NOT NULL DEFAULT 0 COMMENT '结算时间',
  31. `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  32. `updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  33. PRIMARY KEY (`id`) USING BTREE,
  34. KEY `idx_mall_user` (`mall_id`,`user_id`) USING BTREE
  35. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='渠道分红延时结算日志';
  36. SQL;
  37. $this->execute($sql);
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function safeDown()
  43. {
  44. echo "M240621035039CreateAddonsAgentDelayLog cannot be reverted.\n";
  45. return false;
  46. }
  47. /*
  48. // Use up()/down() to run migration code without a transaction.
  49. public function up()
  50. {
  51. }
  52. public function down()
  53. {
  54. echo "M240621035039CreateAddonsAgentDelayLog cannot be reverted.\n";
  55. return false;
  56. }
  57. */
  58. }