'已登场', 2 => '未登场', ); $top = array ( 1 => '不推荐', 2 => '首页推荐', ); $sex = array ( 1 => '男', 2 => '女', 3 => '不详', ); $creater = function() { $array = array ( -1 => array('id' => '', 'name' => '全部造物主',), ); $info = Dever::db('content/creater')->state(); if($info) { $array += $info; } return $array; }; return array ( # 表名 'name' => 'xuniren', # 显示给用户看的名称 'lang' => '虚拟人管理', 'order' => 99, 'end' => array ( 'insert' => 'content/lib/manage.updateXnr', 'update' => 'content/lib/manage.updateXnr', ), # 同步更新另外一个或多个表的多条关联数据,以逗号隔开 'sync' => array ( 'content/creater_xuniren' => array ( # 更新时的条件,另外一个表的字段 => 本表的字段 'where' => array('xid', 'id'), # 要更新的数据 'update' => array('cid' => 'creater_ids'), # 同步更新的类型,delete为先删再插入,update为先查询是否存在,存在直接更新,不存在则插入, only为仅更新 'type' => 'delete', ) ), # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'list' => true, ), 'name' => array ( 'type' => 'varchar-80', 'name' => '名称', 'default' => '', 'desc' => '名称', 'match' => 'is_string', 'update' => 'text', 'list' => true, 'search' => 'fulltext', ), 'ename' => array ( 'type' => 'varchar-30', 'name' => '英文名称', 'default' => '', 'desc' => '英文名称', 'match' => 'is_string', //'update' => 'text', //'list' => true, //'search' => 'fulltext', ), 'shou' => array ( 'type' => 'varchar-80', 'name' => '首字母', 'default' => '', 'desc' => '首字母', 'match' => 'is_string', ), 'pic' => array ( 'type' => 'text-255', 'name' => '形象大图-可以上传多张,图片尺寸530*800px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '形象大图', 'match' => 'option', 'update' => 'images', 'key' => '1', 'place' => '530*800', ), 'sex' => array ( 'type' => 'int-11', 'name' => '性别', 'default' => '1', 'desc' => '性别', 'match' => 'is_numeric', 'update' => 'select', 'option' => $sex, 'search' => 'select', 'list' => true, ), 'bdate' => array ( 'type' => 'int-11', 'name' => '出生日期-将根据出生日期计算年龄,为空则展示不详', 'default' => '', 'desc' => '出生日期', 'match' => 'is_numeric', //'callback' => 'maketime', //'update' => 'time', //'list' => 'date("Y-m-d", {bdate})', ), 'age' => array ( 'type' => 'varchar-100', 'name' => '年龄', 'match' => 'is_string', 'default' => '', 'desc' => '', 'update' => 'text', 'list' => true, ), 'city' => array ( 'type' => 'varchar-500', 'name' => '诞生地', 'default' => '', 'desc' => '诞生地', 'match' => 'is_string', 'update' => 'text', ), 'creater_id' => array ( 'type' => 'int-11', 'name' => '造物主-关联单个造物主,废弃', 'default' => '-1', 'desc' => '造物主', 'match' => 'is_numeric', //'update' => 'select', //'option' => $creater, //'search' => 'select', ), 'creater_ids' => array ( 'type' => 'varchar-1000', 'name' => '关联造物主-关联系统中存在的造物主,直接输入造物主名称,将自动进行匹配出来,之后选择一个即可', 'default' => '', 'desc' => '造物主', 'match' => 'option', 'update' => 'text', 'search' => 'select', 'search' => array ( 'api' => 'content/creater_xuniren-all',//接口地址,最好是获取多条数据的地址 'col' => 'cid',//要查询的字段 'result' => 'xid',//返回的字段 'search' => 'id',//本表的字段,默认为当前的字段 'option' => $creater, ), //如果要输入带有自动提示的,就打开这个,update=>'text'即可 'autocomplete' => array('content/lib/manage.getByCreaterName', 'id', 'content/creater-getData'), //'list' => true, //显示 //'show' => 'cate=tag/manage.getByCate?cate=', ), 'zwz' => array ( 'type' => 'varchar-500', 'name' => '手动输入造物主-手动输入造物主的名称,多个用半角","逗号隔开', 'default' => '', 'desc' => '手动输入造物主', 'match' => 'option', 'update' => 'text', ), 'waimao' => array ( 'type' => 'varchar-500', 'name' => '外貌特征', 'default' => '', 'desc' => '外貌特征', 'match' => 'is_string', 'update' => 'textarea', ), 'aihao' => array ( 'type' => 'varchar-500', 'name' => '爱好特长/职业', 'default' => '', 'desc' => '爱好特长/职业', 'match' => 'is_string', 'update' => 'textarea', ), 'home_info' => array ( 'type' => 'varchar-500', 'name' => '首页简介-不能超过50字', 'default' => '', 'desc' => '首页简介', 'match' => 'option', //'update' => 'textarea', ), 'info' => array ( 'type' => 'varchar-500', 'name' => '简介-不能超过110字', 'default' => '', 'desc' => '简介', 'match' => 'is_string', 'update' => 'textarea', ), 'news' => array ( 'type' => 'text-1000', 'name' => '关联资讯', 'default' => '', 'desc' => '关联资讯', 'match' => 'is_string', 'update' => array ( array ( 'col' => 'name', 'name' => '资讯标题', 'default' => '', 'desc' => '资讯标题', 'match' => 'is_string', 'update' => 'text', ), array ( 'col' => 'link', 'name' => '资讯链接', 'default' => '', 'desc' => '资讯链接', 'match' => 'is_string', 'update' => 'textarea', ), ), ), 'pdate' => array ( 'type' => 'int-11', 'name' => '初登场时间', 'match' => 'is_numeric', 'default' => '', 'desc' => '', //'update' => 'time', //'callback' => 'maketime', //'list' => 'date("Y-m-d H:i:s", {pdate})', ), 'pdate_string' => array ( 'type' => 'varchar-100', 'name' => '初登场时间', 'match' => 'option', 'default' => '', 'desc' => '', 'update' => 'text', //'list' => 'date("Y-m-d H:i:s", {pdate})', ), 'share_title' => array ( 'type' => 'varchar-100', 'name' => '分享标题', 'default' => '', 'desc' => '分享标题', 'match' => 'option', //'update' => 'text', ), 'share_pic' => array ( 'type' => 'varchar-150', 'name' => '分享图片-图片尺寸200*200px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '分享图片', 'match' => 'option', //'update' => 'image', 'key' => '1', 'place' => '200*200', //'upload' => 'qiniu', //'large' => true, ), 'share_content' => array ( 'type' => 'varchar-200', 'name' => '分享内容', 'default' => '', 'desc' => '分享内容', 'match' => 'option', //'update' => 'textarea', ), 'weibo' => array ( 'type' => 'varchar-500', 'name' => '微博地址-输入微博的地址', 'default' => '', 'desc' => '请输入微博地址', 'match' => 'option', 'update' => 'text', ), 'douyin' => array ( 'type' => 'varchar-600', 'name' => '抖音地址', 'default' => '', 'desc' => '抖音地址', 'match' => 'option', 'update' => 'text', ), 'bilibili' => array ( 'type' => 'varchar-600', 'name' => 'B站地址', 'default' => '', 'desc' => 'B站地址', 'match' => 'option', 'update' => 'text', ), 'ins' => array ( 'type' => 'varchar-100', 'name' => 'INS分享内容', 'default' => '', 'desc' => 'INS分享内容', 'match' => 'option', 'update' => 'text', ), 'ins_link' => array ( 'type' => 'varchar-600', 'name' => 'INS链接', 'default' => '', 'desc' => 'INS链接', 'match' => 'option', 'update' => 'text', ), 'beizhu' => array ( 'type' => 'varchar-500', 'name' => '备注', 'default' => '', 'desc' => '备注', 'match' => 'option', 'update' => 'textarea', ), 'reorder' => array ( 'type' => 'int-11', 'name' => '排序(数值越大越靠前)', 'default' => '1', 'desc' => '请输入排序', 'match' => 'option', //'update' => 'text', 'search' => 'order', 'list' => true, 'order' => 'desc', 'edit' => true, ), 'top' => array ( 'type' => 'int-11', 'name' => '是否推荐到首页', 'default' => '1', 'desc' => '是否推荐到首页', 'match' => 'is_numeric', 'update' => 'select', 'option' => $top, 'search' => 'select', 'list' => true, 'edit' => true, ), 'status' => array ( 'type' => 'int-11', 'name' => '登场状态', 'default' => '1', 'desc' => '登场状态', 'match' => 'is_numeric', 'update' => 'select', 'option' => $status, 'search' => 'select', 'list' => true, 'edit' => true, ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', ), 'cdate' => array ( 'type' => 'int-11', 'name' => '创建时间', 'match' => array('is_numeric', time()), 'desc' => '', # 只有insert时才生效 'insert' => true, 'list' => 'date("Y-m-d H:i:s", {cdate})', 'search' => 'date', ), ), # 管理功能 'manage' => array ( ), # 更新表结构 'alter' => array ( ), # request 请求接口定义 'request' => array ( 'search' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'name' => array('yes', 'like'), 'id' => 'yes', 'status' => 1, 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc','cdate' => 'desc'), 'limit' => '0,1000', 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id', ), 'getHome' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'name' => array('yes', 'like'), 'id' => 'yes', 'status' => 1, 'state' => 1, ), 'type' => 'all', 'order' => array('top' => 'desc', 'reorder' => 'desc', 'cdate' => 'desc'), 'limit' => '0,10', 'col' => '*', ), 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'status' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('shou' => 'asc', 'reorder' => 'desc', 'id' => 'desc'), 'col' => '*|shou|', ), 'getDataByCreater' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'creater_id' => 'yes', 'status' => 1, 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'id' => 'desc'), 'page' => array(100, 'list'), 'col' => '*', ), ), );