| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace addons\ScoreExpansion\console\migrations;
- use yii\db\Migration;
- /**
- * Handles the creation of table `{{%score_expansion_recommend_reward_order}}`.
- */
- class M250623092404CreateScoreExpansionRecommendRewardOrderTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_addons_score_expansion_recommend_reward_order` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
- `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单User Id',
- `user_ids` json DEFAULT NULL COMMENT '第一轮之后定下来的关系链',
- `exclude_user_ids` json DEFAULT NULL COMMENT '第二轮开始谁不满足条件排除的user id,存在这里面的user id之后循环都不会奖励',
- `order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单ID',
- `order_detail_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单详情ID',
- `reward_period` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '奖励周期 0每天',
- `frozen_score_issued_total` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '已发放的冻结积分',
- `reward_frozen_score` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '每轮奖励多少个冻结积分',
- `reward_person_count` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '奖励人数',
- `loop_num` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '循环轮数',
- `current_loop_num` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT '当前循环到第几轮了',
- `current_reward_person_index` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '第二轮开始,记录每轮奖励到第几人',
- `is_end` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否结束',
- `last_exec_date` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后一次执行奖励时间',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='已参与推荐奖励的订单记录表';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- }
|