| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 | <?php$status = array(    1 => '已登场',    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' => '*',        ),    ),);
 |