CREATE TABLE IF NOT EXISTS `chii_characters` (
`crt_id` mediumint(8) unsigned NOT NULL,
`crt_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`crt_role` tinyint(4) unsigned NOT NULL COMMENT '角色,机体,组织。。',
`crt_infobox` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`crt_summary` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`crt_img` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`crt_comment` mediumint(9) unsigned NOT NULL DEFAULT '0',
`crt_collects` mediumint(8) unsigned NOT NULL,
`crt_dateline` int(10) unsigned NOT NULL,
`crt_lastpost` int(11) unsigned NOT NULL,
`crt_lock` tinyint(4) NOT NULL DEFAULT '0',
`crt_img_anidb` varchar(255) CHARACTER SET utf8 NOT NULL,
`crt_anidb_id` mediumint(8) unsigned NOT NULL,
`crt_ban` tinyint(3) unsigned NOT NULL DEFAULT '0',
`crt_redirect` int(10) unsigned NOT NULL DEFAULT '0',
`crt_nsfw` tinyint(1) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
角色主表
crt_img_anidb
为废弃字段。
crt_lastpost
为最近的用户评论日期。
角色参与的条目在chii_crt_subject_index
表中。
CREATE TABLE IF NOT EXISTS `chii_crt_subject_index` (
`crt_id` mediumint(9) unsigned NOT NULL,
`subject_id` mediumint(9) unsigned NOT NULL,
`subject_type_id` tinyint(4) unsigned NOT NULL,
`crt_type` tinyint(4) unsigned NOT NULL COMMENT '主角,配角',
`ctr_appear_eps` mediumtext COLLATE utf8_unicode_ci NOT NULL COMMENT '可选,角色出场的的章节',
`crt_order` tinyint(3) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ctr_appear_eps
目前为空,没用到。
crt_type
只有三种,跟条目类型无关。
$typeList = array(
1 => '主角',
2 => '配角',
3 => '客串',
);
chii_person_fields
表为现实人物和虚拟角色的 wiki 解析字段。
CREATE TABLE IF NOT EXISTS `chii_person_fields` (
`prsn_cat` enum('prsn','crt') COLLATE utf8_unicode_ci NOT NULL,
`prsn_id` int(8) unsigned NOT NULL,
`gender` tinyint(4) unsigned NOT NULL,
`bloodtype` tinyint(4) unsigned NOT NULL,
`birth_year` year(4) NOT NULL,
`birth_mon` tinyint(2) unsigned NOT NULL,
`birth_day` tinyint(2) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
表的主键为('prsn_cat', 'prsn_id')
此表中的prsn_cat
可能为"prsn"
或"crt"
。查询时通过psrn_cat
和prsn_id
进行查询。查询角色信息的时候使用prsn_cat = "crt"