123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?php
- $channel = function()
- {
- $array = array(-1 => array('name' => '父级栏目'));
- $channel = Dever::db('atom/channel')->parent();
- if ($channel) {
- $array += $channel;
- }
- return $array;
- };
- return array
- (
- # 表名
- 'name' => 'channel',
- # 显示给用户看的名称
- 'lang' => '栏目',
- 'order' => 19,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '栏目ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- //'search' => 'order',
- 'order' => 'desc',
- 'list' => true,
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-60',
- 'name' => '栏目名称',
- 'default' => '',
- 'desc' => '请输入栏目名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
-
- 'channel_id' => array
- (
- 'type' => 'int-11',
- 'name' => '上级栏目',
- 'default' => Dever::input('option_channel_id', -1),
- 'desc' => '请选择上级栏目',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'search' => 'order,select',
- //'list' => '{channel_id} > 0 ? Dever::load("atom/channel-one#name", {channel_id}) : "父级栏目"',
- 'option' => $channel,
- ),
-
- 'pic' => array
- (
- 'type' => 'varchar-150',
- 'name' => '栏目图片-选填,大小为150X150px',
- 'default' => '',
- 'desc' => '请选择栏目图片',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '1',
- 'place' => '150',
- ),
-
- 'info' => array
- (
- 'type' => 'varchar-500',
- 'name' => '栏目介绍-选填,字数不超过500字,出现栏目头部,如果想清空该介绍,请输入null。',
- 'default' => '',
- 'desc' => '请输入栏目介绍',
- 'match' => 'option',
- 'update' => 'textarea',
- ),
-
- 'link' => array
- (
- 'type' => 'varchar-150',
- 'name' => '栏目链接-选填,如果填写了链接,则点击本栏目直接跳转至本链接。',
- 'default' => '',
- 'desc' => '请输入栏目链接',
- 'match' => 'option',
- 'update' => 'text',
- ),
-
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序(数值越大越靠前)',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'order',
- 'list_name' => '排序',
- 'list' => true,
- 'order' => 'desc',
- '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})',
- ),
- ),
- # 权限精细控制 加入到该项目的详细权限中,注意与top的不同
- /*
- 'auth' => array
- (
- # 类型 1为单一类型,只将表里的数据作为单一权限,2为复杂类型,可以根据获取到的数据分父级子级处理。此处数据来源很重要,这也是和top的区别。
- 'type' => 2,
- # 数据来源
- 'data' => 'atom/channel.get',
- # 菜单名
- 'name' => '栏目',
- # 默认值
- 'value' => 1,
- # 对应的字段值,设置这个之后,所有设置auth等于这个值的字段,都要遵循这个权限的控制
- 'key' => 'channel',
- # 本表中代表名称的字段
- 'col' => 'name',
- ),
- */
-
- 'manage' => array
- (
- # 列表页的类型
- 'list_type' => 'parent',
- 'list_button' => array
- (
- 21 => array('新增子栏目', '"channel&option_channel_id={id}&oper_parent=channel"', '{channel_id}<=0'),
- ),
- ),
-
- # request 请求接口定义
- 'request' => array
- (
- # main 取所有主栏目
- 'parent' => array
- (
- 'where' => array
- (
- 'channel_id' => -1,
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'desc'),
- 'col' => '*|id',
- ),
-
- # 取所有下级栏目
- 'child' => array
- (
- 'where' => array
- (
- 'channel_id' => array('1', '>='),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'desc'),
- 'col' => '*|channel_id|id|',
- ),
- ),
- );
|