| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 | <?php$status = array(    1 => '已登场',    2 => '未登场',);$top = array(    1 => '不推荐',    2 => '首页推荐',);$sex = array(    1 => '男',    2 => '女',    3 => '不详',);$creater = function(){    $array = array();    $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',    ),    # 数据结构    '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'      => '形象大图-可以上传多张,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',            'default'   => '',            'desc'      => '形象大图',            'match'     => 'option',            'update'    => 'images',            'key'       => '1',            'place'     => '1242*1863',        ),        'sex'        => array        (            'type'      => 'int-11',            'name'      => '性别',            'default'   => '1',            'desc'      => '性别',            'match'     => 'is_numeric',            'update'    => 'select',            'option'    => $sex,            'search'    => 'select',            'list'      => true,        ),        'birth'      => array        (            'type'      => 'int-11',            'name'      => '出生日期-将根据出生日期计算年龄,为空则展示不详',            'default'   => '',            'desc'      => '出生日期',            'match'     => 'is_numeric',            'update'    => 'date',            'list'      => 'date("Y-m-d H:i:s", {birth})',        ),        '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',        ),        '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',        ),        'info'      => array        (            'type'      => 'varchar-500',            'name'      => '简介',            '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'     => array('is_numeric', time()),            'default'   => '',            'desc'      => '',            'update'    => 'date',            'callback'  => 'maketime',            //'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'      => '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',            'default'   => '',            'desc'      => '分享图片',            'match'     => 'option',            'update'    => 'image',            'key'       => '1',            'place'     => '150',            //'upload'  => 'qiniu',            //'large'   => true,        ),        'share_content'     => array        (            'type'      => 'varchar-200',            'name'      => '分享内容',            'default'   => '',            'desc'      => '分享内容',            'match'     => 'option',            'update'    => 'textarea',        ),        '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    (    ),    # 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',        ),    ),);
 |