hasTable('sign_ins'); if (!$exists) { $table = $this->table('sign_ins', ['comment' => '玩家签到表']); $table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '玩家id']) ->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '渠道/部门id']) ->addColumn('sign_date', 'date', ['default' => null, 'comment' => '签到日期']) ->addColumn('reward_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '签到奖励']) ->addColumn('chip_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '打码量']) ->addColumn('created_at', 'timestamp', ['comment' => '创建时间']) ->addColumn('updated_at', 'timestamp', ['comment' => '更新时间']) ->addIndex(['player_id'], ['name' => 'idx_player_id']) ->addIndex(['department_id'], ['name' => 'idx_department_id']) ->create(); } } }