初始化

This commit is contained in:
2026-03-02 13:44:38 +08:00
commit 05b785083c
677 changed files with 58662 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateChannel extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('channel');
if (!$exists) {
$table = $this->table('channel', ['comment' => '渠道']);
$table->addColumn('name', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '渠道名称'])
->addColumn('domain', 'string', ['limit' => 80, 'null' => false, 'default' => '', 'comment' => '渠道域名'])
->addColumn('lang', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '语言'])
->addColumn('currency', 'string', ['limit' => 10, 'null' => false, 'default' => '', 'comment' => '币别代码'])
->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '部门id'])
->addColumn('site_id', 'string', ['limit' => 100, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '渠道编号'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)'])
->addColumn('recharge_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '平台充值(0:禁用,1:启用)'])
->addColumn('withdraw_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '平台提现状态(0:禁用,1:启用)'])
->addColumn('web_login_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => 'web登录状态(0:禁用,1:启用)'])
->addColumn('recharge_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '官方总充值金额'])
->addColumn('withdraw_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '官方总提现金额'])
->addColumn('wallet_action_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '玩家钱包操作功能'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addColumn('deleted_at', 'timestamp', ['comment' => '删除时间'])
->addIndex(['name'], ['unique' => true, 'name' => 'uni_name'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->addIndex(['user_id'], ['name' => 'idx_user_id'])
->create();
}
}
}

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminConfigs extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_configs');
if (!$exists) {
$table = $this->table('admin_configs', ['comment' => '系统配置表']);
$table->addColumn('name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '配置字段'])
->addColumn('value', 'text', ['limit' => MysqlAdapter::TEXT_MEDIUM, 'comment' => '工控返回'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->create();
}
}
}

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminDepartment extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_department');
if (!$exists) {
$table = $this->table('admin_department', ['comment' => '部门表']);
$table->addColumn('pid', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '上级部门'])
->addColumn('name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '部门名称'])
->addColumn('leader', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '负责人'])
->addColumn('phone', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '手机号'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '状态1=正常,0=禁用'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '1 部门 2渠道'])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '排序'])
->addColumn('path', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '手机号'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addColumn('deleted_at', 'timestamp', ['comment' => '删除时间'])
->create();
}
}
}

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminFileAttachmentCates extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_file_attachment_cates');
if (!$exists) {
$table = $this->table('admin_file_attachment_cates', ['comment' => '系统附件分类']);
$table->addColumn('name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '分类名称'])
->addColumn('pid', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '上级id'])
->addColumn('permission_type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '0所有人1仅自己'])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '排序'])
->addColumn('admin_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '后台用户id'])
->create();
}
}
}

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminFileAttachments extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_file_attachments');
if (!$exists) {
$table = $this->table('admin_file_attachments', ['comment' => '系统附件分类']);
$table->addColumn('cate_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '分类id'])
->addColumn('uploader_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '上传人id'])
->addColumn('type', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => 'image图片 file文件'])
->addColumn('file_type', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '文件类型'])
->addColumn('name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '附件名称'])
->addColumn('real_name', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '原始文件名'])
->addColumn('path', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '路径'])
->addColumn('url', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '访问url'])
->addColumn('ext', 'string', ['limit' => 10, 'null' => false, 'default' => '', 'comment' => '文件后缀'])
->addColumn('disk', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => 'disk'])
->addColumn('size', 'integer', ['limit' => MysqlAdapter::INT_BIG, 'null' => false, 'default' => 0, 'comment' => '文件大小'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('deleted_at', 'datetime', ['comment' => '删除时间'])
->create();
}
}
}

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminMenus extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_menus');
if (!$exists) {
$table = $this->table('admin_menus', ['comment' => '系统菜单表']);
$table->addColumn('name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '名称'])
->addColumn('icon', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '图标'])
->addColumn('url', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '链接'])
->addColumn('plugin', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '插件名称'])
->addColumn('pid', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '父级id'])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '排序'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '类型 1 总站 2渠道'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)'])
->addColumn('open', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '菜单展开(0:收起,1:展开)'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->create();
}
}
}

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminPost extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_post');
if (!$exists) {
$table = $this->table('admin_post', ['comment' => '岗位']);
$table->addColumn('name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '岗位名称'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)'])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '排序'])
->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门id'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '类型 1 总站 2渠道'])
->addColumn('deleted_at', 'datetime', ['comment' => '更新时间'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->create();
}
}
}

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminRoleDepartment extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_role_department');
if (!$exists) {
$table = $this->table('admin_role_department', ['comment' => '角色数据权限部门关联表']);
$table->addColumn('role_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('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->create();
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminRoleMenus extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_role_menus');
if (!$exists) {
$table = $this->table('admin_role_menus', ['comment' => '系统角色菜单表']);
$table->addColumn('role_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '角色id'])
->addColumn('menu_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '菜单id'])
->addIndex(['role_id', 'menu_id'], ['name' => 'idx_role_id_menu_id'])
->create();
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminRolePermissions extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_role_permissions');
if (!$exists) {
$table = $this->table('admin_role_permissions', ['comment' => '系统角色权限表']);
$table->addColumn('role_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '角色id'])
->addColumn('node_id', 'string', ['limit' => 255, 'null' => false, 'default' => '0', 'comment' => '节点id'])
->addIndex(['role_id', 'node_id'], ['name' => 'idx_role_id_node_id'])
->create();
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminRoleUsers extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_role_users');
if (!$exists) {
$table = $this->table('admin_role_users', ['comment' => '系统角色用户表']);
$table->addColumn('role_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '角色id'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '用户id'])
->addIndex(['role_id', 'user_id'], ['name' => 'idx_role_id_user_id'])
->create();
}
}
}

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminRoles extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_roles');
if (!$exists) {
$table = $this->table('admin_roles', ['comment' => '系统角色表']);
$table->addColumn('name', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '权限角色名称'])
->addColumn('desc', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '备注说明'])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '排序'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('check_strictly', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '数据权限类型:0=全部数据权限,1=自定义数据权限,2=本部门及以下数据权限,3=本部门数据权限,4=本人数据权限'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '1 总后台 2渠道后台'])
->create();
}
}
}

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAdminUsers extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('admin_users');
if (!$exists) {
$table = $this->table('admin_users', ['comment' => '系统用户表']);
$table->addColumn('username', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '用户账号'])
->addColumn('password', 'string', ['limit' => 80, 'null' => false, 'default' => '', 'comment' => '密码'])
->addColumn('nickname', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '姓名'])
->addColumn('avatar', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '头像'])
->addColumn('email', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '邮箱'])
->addColumn('phone', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '手机号'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '1 部门 2渠道'])
->addColumn('is_super', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '是否超管'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)'])
->addColumn('remember_token', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '备注说明'])
->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门id'])
->addColumn('post', 'text', ['limit' => MysqlAdapter::TEXT_LONG, 'comment' => '岗位'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('deleted_at', 'datetime', ['comment' => '删除时间'])
->addIndex(['username'], ['name' => 'uni_username', 'unique' => true])
->create();
}
}
}

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateAnnouncement extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('announcement');
if (!$exists) {
$table = $this->table('announcement', ['comment' => '公告']);
$table->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门/渠道id'])
->addColumn('title', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '内容'])
->addColumn('content', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '姓名'])
->addColumn('valid_time', 'datetime', ['null' => true, 'comment' => '有效时间'])
->addColumn('push_time', 'datetime', ['null' => true, 'comment' => '发布时间'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '狀態0=停用, 1=啟用'])
->addColumn('priority', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => true, 'comment' => '优先级'])
->addColumn('admin_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('admin_name', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '管理员名称'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('deleted_at', 'datetime', ['comment' => '删除时间'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->addIndex(['admin_id'], ['name' => 'idx_admin_id'])
->create();
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateApiErrorLog extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('api_error_log');
if (!$exists) {
$table = $this->table('api_error_log', ['comment' => 'api请求错误日志']);
$table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('target', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '资源表'])
->addColumn('target_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '资源id'])
->addColumn('url', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '请求地址'])
->addColumn('params', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '参数'])
->addColumn('content', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '错误内容'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->create();
}
}
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateChannelFinancialRecord extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('channel_financial_record');
if (!$exists) {
$table = $this->table('channel_financial_record', ['comment' => '渠道财务记录']);
$table->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '部门/渠道id'])
->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('target', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '資料表'])
->addColumn('target_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '資料id'])
->addColumn('action', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '操作'])
->addColumn('tradeno', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '單號'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('user_name', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '管理员名称'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->addIndex(['user_id'], ['name' => 'idx_user_id'])
->create();
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateCurrency extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('currency');
if (!$exists) {
$table = $this->table('currency', ['comment' => '货币配置']);
$table->addColumn('name', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '货币名称'])
->addColumn('identifying', 'string', ['limit' => 80, 'null' => false, 'default' => '', 'comment' => '货币标识'])
->addColumn('ratio', 'decimal', ['precision' => 14, 'scale' => 4, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '1货币 = 点数'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '狀態0=停用, 1=啟用'])
->addColumn('admin_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('deleted_at', 'datetime', ['comment' => '删除时间'])
->addIndex(['identifying'], ['name' => 'uni_identifying', 'unique' => true])
->create();
}
}
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateExternalApp extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('external_app');
if (!$exists) {
$table = $this->table('external_app', ['comment' => '外部应用']);
$table->addColumn('name', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '应用名称'])
->addColumn('white_ip', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR, 'comment' => '白化IP'])
->addColumn('app_id', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => 'app_id'])
->addColumn('app_secret', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => 'app_secret'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('user_name', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '管理员名称'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '狀態0=停用, 1=啟用'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('deleted_at', 'datetime', ['comment' => '删除时间'])
->addIndex(['name'], ['name' => 'uni_name', 'unique' => true])
->addIndex(['user_id'], ['name' => 'idx_user_id'])
->create();
}
}
}

View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePhoneSmsLog extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('phone_sms_log');
if (!$exists) {
$table = $this->table('phone_sms_log', ['comment' => '手机短信日志']);
$table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('phone', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '手机号'])
->addColumn('code', 'string', ['limit' => 10, 'null' => false, 'default' => '', 'comment' => '驗證碼'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'comment' => '类型 1 登录 2注册 3修改密码'])
->addColumn('expire_time', 'datetime', ['default' => null, 'comment' => '過期時間'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '狀態0=失敗, 1=成功'])
->addColumn('send_times', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 1, 'comment' => '發送次數'])
->addColumn('response', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR, 'comment' => '簡訊商回傳內容'])
->addColumn('uid', 'string', ['limit' => 40, 'null' => false, 'default' => '', 'comment' => '短信发送编号'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->addIndex(['phone'], ['name' => 'idx_phone'])
->create();
}
}
}

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayer extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player');
if (!$exists) {
$table = $this->table('player', ['comment' => '玩家']);
$table->addColumn('talk_user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => null, 'comment' => '来聊聊账号id'])
->addColumn('uuid', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => 'uuid'])
->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门id'])
->addColumn('recommend_id', 'integer', ['limit' => MysqlAdapter::INT_BIG, 'default' => null, 'comment' => '推广id'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'signed' => false, 'null' => false, 'default' => 1, 'comment' => '1 玩家'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '帐号状态 1啟用 0停用'])
->addColumn('status_withdraw', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'signed' => false, 'null' => false, 'default' => 1, 'comment' => '取款状态 1啟用 0停用'])
->addColumn('status_transfer', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '轉點功能'])
->addColumn('name', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '姓名'])
->addColumn('phone', 'string', ['limit' => 25, 'null' => false, 'default' => '', 'comment' => '手机号'])
->addColumn('country_code', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '手機國際碼'])
->addColumn('recommend_code', 'string', ['limit' => 10, 'null' => false, 'default' => '', 'comment' => '玩家推广码'])
->addColumn('recommended_code', 'string', ['limit' => 10, 'null' => false, 'default' => '', 'comment' => '输入推广码'])
->addColumn('play_password', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '玩家支付密码'])
->addColumn('password', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '玩家密碼'])
->addColumn('currency', 'string', ['limit' => 5, 'null' => false, 'default' => '', 'comment' => '币别代码'])
->addColumn('flag', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '玩家標籤'])
->addColumn('avatar', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '头像'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addColumn('deleted_at', 'timestamp', ['comment' => '删除时间'])
->addColumn('player_tag', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '玩家標籤'])
->addIndex(['status'], ['name' => 'idx_status'])
->addIndex(['currency'], ['name' => 'idx_currency'])
->addIndex(['talk_user_id'], ['name' => 'idx_talk_user_id'])
->addIndex(['recommend_id'], ['name' => 'idx_recommend_id'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->addIndex(['uuid'], ['name' => 'idx_uuid'])
->addIndex(['phone'], ['name' => 'idx_phone'])
->create();
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerBank extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_bank');
if (!$exists) {
$table = $this->table('player_bank', ['comment' => '玩家银行账户']);
$table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('bank_name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '银行名称'])
->addColumn('account', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '银行账号'])
->addColumn('account_name', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '账户所属人'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('deleted_at', 'datetime', ['comment' => '删除时间'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->create();
}
}
}

View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerDeliveryRecord extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_delivery_record');
if (!$exists) {
$table = $this->table('player_delivery_record', ['comment' => '玩家变账记录']);
$table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'comment' => '玩家id'])
->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'comment' => '渠道/部门id'])
->addColumn('code', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '機台編號'])
->addColumn('target', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '交易資料表'])
->addColumn('target_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '資料id'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'signed' => false, 'null' => false, 'comment' => '类型'])
->addColumn('source', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '来源'])
->addColumn('amount', 'decimal', ['precision' => 32, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '金额'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '操作管理员id'])
->addColumn('user_name', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '操作管理员名称'])
->addColumn('amount_before', 'decimal', ['precision' => 32, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '異動前金額'])
->addColumn('amount_after', 'decimal', ['precision' => 32, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '金额'])
->addColumn('tradeno', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '單號'])
->addColumn('remark', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '备注'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->addIndex(['type'], ['name' => 'idx_type'])
->addIndex(['source'], ['name' => 'idx_source'])
->addIndex(['amount'], ['name' => 'idx_amount'])
->addIndex(['tradeno'], ['name' => 'idx_tradeno'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->create();
}
}
}

View File

@@ -0,0 +1,53 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerExtend extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_extend');
if (!$exists) {
$table = $this->table('player_extend', ['comment' => '玩家扩展数据']);
$table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('sex', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'signed' => false, 'default' => null, 'comment' => '性別 1男 2女 3三性'])
->addColumn('email', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '信箱'])
->addColumn('ip', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '注册IP'])
->addColumn('qq', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => 'qq号'])
->addColumn('telegram', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => 'telegram'])
->addColumn('birthday', 'date', ['default' => null, 'comment' => '生日'])
->addColumn('id_number', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '身分證'])
->addColumn('address', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '地址'])
->addColumn('wechat', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '微信号'])
->addColumn('facebook', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => 'facebook'])
->addColumn('line', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => 'line'])
->addColumn('remark', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '备注'])
->addColumn('recharge_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '总充值金额'])
->addColumn('withdraw_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '总提现金额'])
->addColumn('present_in_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '总提转入金额'])
->addColumn('present_out_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '总提转出金额'])
->addColumn('third_recharge_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '第三方总充值金额'])
->addColumn('third_withdraw_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '第三方总提现金额'])
->addColumn('coin_recharge_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '币商充值总金额'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addColumn('deleted_at', 'timestamp', ['comment' => '删除时间'])
->addIndex(['player_id'], ['name' => 'uni_player_id', 'unique' => true])
->create();
}
}
}

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerLoginRecord extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_login_record');
if (!$exists) {
$table = $this->table('player_login_record', ['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('login_domain', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '登錄域名'])
->addColumn('ip', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => 'ip'])
->addColumn('country_name', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '國家名稱'])
->addColumn('city_name', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '地區名稱'])
->addColumn('remark', 'string', ['limit' => 125, 'null' => false, 'default' => '', '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();
}
}
}

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerMoneyEditLog extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_money_edit_log');
if (!$exists) {
$table = $this->table('player_money_edit_log', ['comment' => '玩家钱包管理员调整日志']);
$table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '類型 1=存 0=出'])
->addColumn('action', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '手動輸入類型'])
->addColumn('tradeno', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '單號'])
->addColumn('currency', 'string', ['limit' => 10, 'null' => false, 'default' => '', 'comment' => '幣種'])
->addColumn('money', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '金額'])
->addColumn('origin_money', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '原始金額'])
->addColumn('after_money', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '異動後金額'])
->addColumn('inmoney', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '實際金額'])
->addColumn('subsidy_money', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '補助金額'])
->addColumn('bet_multiple', 'decimal', ['precision' => 8, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '流水倍數'])
->addColumn('bet_num', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '流水'])
->addColumn('remark', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '資金調整備註'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('user_name', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '管理员名称'])
->addColumn('deleted_at', 'timestamp', ['comment' => '更新时间'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['tradeno'], ['name' => 'idx_tradeno', 'unique' => true])
->addIndex(['user_id'], ['name' => 'idx_user_id'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->create();
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerPlatformCash extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_platform_cash');
if (!$exists) {
$table = $this->table('player_platform_cash', ['comment' => '玩家钱包']);
$table->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('platform_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '平台id'])
->addColumn('platform_name', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '平台名稱'])
->addColumn('money', 'decimal', ['precision' => 16, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '點數'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '钱包状态'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->addIndex(['platform_id'], ['name' => 'idx_platform_id'])
->create();
}
}
}

View File

@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerRechargeRecord extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_recharge_record');
if (!$exists) {
$table = $this->table('player_recharge_record', ['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('talk_user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => null, 'comment' => '来聊聊账号id'])
->addColumn('setting_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => null, 'comment' => '充值账号配置id'])
->addColumn('tradeno', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '單號'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '狀態, 0=充值中 1=待审核, 2=成功, 3=失败, 4=取消(用户取消) 5=拒绝 6=已关闭(后端取消任务)'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '1来聊聊充值(第三方充值) 2渠道充值(官方充值) 3币商转入'])
->addColumn('player_name', 'string', ['limit' => 20, 'null' => false, 'default' => null, 'comment' => '玩家姓名'])
->addColumn('player_phone', 'string', ['limit' => 20, 'null' => false, 'default' => null, 'comment' => '玩家手機號碼'])
->addColumn('point', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '充值点数'])
->addColumn('money', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '充值金額'])
->addColumn('inmoney', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '實際充值金額'])
->addColumn('currency', 'string', ['limit' => 10, 'null' => false, 'default' => null, 'comment' => '幣種'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('user_name', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '管理员'])
->addColumn('player_tag', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '玩家標籤'])
->addColumn('remark', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '備註'])
->addColumn('reject_reason', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '拒绝原因'])
->addColumn('notify_result', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '異步通知回傳結果'])
->addColumn('certificate', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '付款凭证'])
->addColumn('finish_time', 'datetime', ['comment' => '入款成功时间'])
->addColumn('cancel_time', 'datetime', ['comment' => '取消時間'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['tradeno'], ['name' => 'uni_tradeno', 'unique' => true])
->addIndex(['status'], ['name' => 'idx_status'])
->addIndex(['type'], ['name' => 'idx_type'])
->addIndex(['player_name'], ['name' => 'idx_player_name'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->addIndex(['talk_user_id'], ['name' => 'idx_talk_user_id'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->create();
}
}
}

View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerRegisterRecord extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_register_record');
if (!$exists) {
$table = $this->table('player_register_record', ['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('register_domain', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '登錄域名'])
->addColumn('ip', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => 'ip'])
->addColumn('country_name', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '國家名稱'])
->addColumn('city_name', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '地區名稱'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '類型 0未讀 1已讀'])
->addColumn('remark', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '備註'])
->addColumn('device', 'string', ['limit' => 125, 'null' => false, 'default' => '', '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();
}
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreatePlayerTag extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_tag');
if (!$exists) {
$table = $this->table('player_tag', ['comment' => '玩家标签']);
$table->addColumn('name', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '标签名称'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->create();
}
}
}

View File

@@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerWithdrawRecord extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_withdraw_record');
if (!$exists) {
$table = $this->table('player_withdraw_record', ['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('talk_user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => null, 'comment' => '来聊聊账号id'])
->addColumn('player_tag', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '玩家標籤'])
->addColumn('tradeno', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '單號'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '狀態, 1=提现中(待审核), 2=成功, 3=失败 , 4=待打款, 5=不通过, 6=玩家取消, 7=系统取消'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '1=来聊聊 , 2=银行卡'])
->addColumn('player_name', 'string', ['limit' => 20, 'null' => false, 'default' => null, 'comment' => '玩家姓名'])
->addColumn('player_phone', 'string', ['limit' => 20, 'null' => false, 'default' => null, 'comment' => '玩家手機號碼'])
->addColumn('point', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '游戏点数'])
->addColumn('money', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '出款金額'])
->addColumn('inmoney', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '實際出款金額'])
->addColumn('fee', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '手續費'])
->addColumn('bank_name', 'string', ['limit' => 100, 'null' => false, 'default' => null, 'comment' => '银行名称'])
->addColumn('account', 'string', ['limit' => 100, 'null' => false, 'default' => null, 'comment' => '银行账号'])
->addColumn('account_name', 'string', ['limit' => 100, 'null' => false, 'default' => null, 'comment' => '账户所属人'])
->addColumn('currency', 'string', ['limit' => 100, 'null' => false, 'default' => null, 'comment' => '幣種'])
->addColumn('remark', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '備註'])
->addColumn('reject_reason', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '拒绝原因'])
->addColumn('finish_time', 'datetime', ['comment' => '出款成功時間'])
->addColumn('cancel_time', 'datetime', ['comment' => '取消時間'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('user_name', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '管理员'])
->addColumn('certificate', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '打款凭证'])
->addIndex(['tradeno'], ['name' => 'uni_tradeno', 'unique' => true])
->addIndex(['status'], ['name' => 'idx_status'])
->addIndex(['player_name'], ['name' => 'idx_player_name'])
->addIndex(['player_id'], ['name' => 'idx_player_id'])
->addIndex(['talk_user_id'], ['name' => 'idx_talk_user_id'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->create();
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateSlider extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('slider');
if (!$exists) {
$table = $this->table('slider', ['comment' => '轮播图']);
$table->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门/渠道id'])
->addColumn('url', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '超連結'])
->addColumn('content', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR, 'comment' => '內文'])
->addColumn('picture_url', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '圖片位置'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '狀態0=停用, 1=啟用'])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '排序'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addColumn('deleted_at', 'timestamp', ['comment' => '删除时间'])
->create();
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateSystemSetting extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('system_setting');
if (!$exists) {
$table = $this->table('system_setting', ['comment' => '系统设计']);
$table->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门/渠道id'])
->addColumn('feature', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '功能名稱'])
->addColumn('num', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => null, 'comment' => '數量'])
->addColumn('content', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR, 'comment' => '內容'])
->addColumn('date_start', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '开始时间'])
->addColumn('date_end', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '结束时间'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 1, 'comment' => '1啟用 0停用'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->create();
}
}
}

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreatePlayerEditLog extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('player_edit_log');
if (!$exists) {
$table = $this->table('player_edit_log', ['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('origin_data', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR, 'comment' => '原数据'])
->addColumn('new_data', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR, 'comment' => '新数据'])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('user_name', 'string', ['limit' => 50, 'null' => false, 'default' => '', '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'])
->addIndex(['user_id'], ['name' => 'idx_user_id'])
->create();
}
}
}

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateNotice extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('notice');
if (!$exists) {
$table = $this->table('notice', ['comment' => '消息']);
$table->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '部门/渠道id'])
->addColumn('player_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '玩家id'])
->addColumn('source_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '来源id'])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '1 系统, 2派彩'])
->addColumn('title', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '标题'])
->addColumn('content', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '内容'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '狀態0=未读, 1=已读'])
->addColumn('receiver', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '接受方1=玩家, 2=总后台, 2=子站'])
->addColumn('is_private', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '是否私人消息0=否, 1=是'])
->addColumn('admin_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '管理员id'])
->addColumn('admin_name', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '管理员名称'])
->addColumn('created_at', 'datetime', ['comment' => '创建时间'])
->addColumn('updated_at', 'datetime', ['comment' => '更新时间'])
->addColumn('deleted_at', 'datetime', ['comment' => '删除时间'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->addIndex(['admin_id'], ['name' => 'idx_admin_id'])
->create();
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateSignIns extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->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();
}
}
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateChipChanges extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$exists = $this->hasTable('chip_changes');
if (!$exists) {
$table = $this->table('chip_changes', ['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('type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '1 增加 2减少'])
->addColumn('source_type', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '来源'])
->addColumn('source_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '0 充值 1活动 2游戏'])
->addColumn('chip_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '打码量'])
->addColumn('before_chip_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '变化前打码量'])
->addColumn('after_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();
}
}
}

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class ModifyPlayerChipAmount extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$table = $this->table('player');
$table->addColumn('chip_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '当前打码量'])
->addColumn('must_chip_amount', 'decimal', ['precision' => 10, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '达成打码量'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateActivity extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$table = $this->table('activity', ['comment' => '活动']);
$table->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '渠道/部门id'])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '狀態0=停用, 1=啟用'])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '排序'])
->addColumn('link', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '连接地址'])
->addColumn('recharge_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '充值配置id'])
->addColumn('start_time', 'datetime', ['default' => null, 'comment' => '开始时间'])
->addColumn('end_time', 'datetime', ['default' => null, 'comment' => '结束时间'])
->addColumn('deleted_at', 'timestamp', ['comment' => '删除时间'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['department_id'], ['name' => 'idx_department_id'])
->create();
}
}

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;
final class CreateActivityContent extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{
$table = $this->table('activity_content', ['comment' => '活动内容']);
$table->addColumn('name', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '活动名称'])
->addColumn('activity_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '活动ID'])
->addColumn('lang', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '语言标识'])
->addColumn('link', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '连接地址'])
->addColumn('picture', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '主图'])
->addColumn('created_at', 'timestamp', ['comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', ['comment' => '更新时间'])
->addIndex(['activity_id'], ['name' => 'idx_activity_id'])
->create();
}
}