Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 2.53 KB

角色.md

File metadata and controls

75 lines (60 loc) · 2.53 KB

基础信息

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_catprsn_id进行查询。查询角色信息的时候使用prsn_cat = "crt"